@@ -1655,6 +1655,21 @@ void cbSignalUARTReq(char *data, uint16_t len) {
16551655 WS_DEBUG_PRINTLN (" ERROR: Unable to decode UART Signal message" );
16561656}
16571657
1658+ /* !
1659+ @brief Deserializes a DisplayRequest message and sends it to the display component.
1660+ @param stream
1661+ Incoming data stream from buffer.
1662+ @param field
1663+ Protobuf message's tag type.
1664+ @param arg
1665+ Optional arguments from decoder calling function.
1666+ @returns True if decoded successfully, False otherwise.
1667+ */
1668+ bool cbDecodeDisplayMsg (pb_istream_t *stream, const pb_field_t *field, void **arg) {
1669+ // TODO: Need to write deserializer logic here
1670+ return true ;
1671+ }
1672+
16581673/* !
16591674 @brief Called when the device receives a new message from the
16601675 /display/ topic.
@@ -1675,14 +1690,12 @@ void cbDisplayMessage(char *data, uint16_t len) {
16751690
16761691 // Set up the payload callback, which will set up the callbacks for
16771692 // each oneof payload field once the field tag is known
1678- // TODO:
1679- // WS.msgPixels.cb_payload.funcs.decode = cbDecodePixelsMsg;
1693+ WS.msgSignalDisplay .cb_payload .funcs .decode = cbDecodeDisplayMsg;
16801694
16811695 // Decode pixel message from buffer
16821696 pb_istream_t istream = pb_istream_from_buffer (WS._buffer , WS.bufSize );
1683- // TODO: Change fields and message type here
1684- if (!ws_pb_decode (&istream, wippersnapper_signal_v1_PixelsRequest_fields,
1685- &WS.msgPixels ))
1697+ if (!ws_pb_decode (&istream, wippersnapper_signal_v1_DisplayRequest_fields,
1698+ &WS.msgSignalDisplay ))
16861699 WS_DEBUG_PRINTLN (" ERROR: Unable to decode display message" );
16871700}
16881701
0 commit comments