Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed mbed-rtos Xbus
Diff: xbus/xbusparser.c
- Revision:
- 22:3eab999c5076
- Parent:
- 19:46e88d37ecef
- Child:
- 23:8171449f0dc3
--- a/xbus/xbusparser.c Tue May 19 16:59:11 2015 +0200
+++ b/xbus/xbusparser.c Tue May 19 16:59:53 2015 +0200
@@ -83,6 +83,7 @@
switch (mid)
{
case XMID_DeviceId:
+ case XMID_OutputConfig:
return true;
default:
@@ -109,6 +110,30 @@
}
break;
+ case XMID_OutputConfig:
+ {
+ uint8_t fields = parser->currentMessage.length / 4;
+ struct OutputConfiguration* conf = parser->callbacks.allocateBuffer(fields * sizeof(struct OutputConfiguration));
+ uint8_t const* dptr = parser->rxBuffer;
+ if (conf)
+ {
+ parser->currentMessage.data = conf;
+ parser->currentMessage.length = fields;
+
+ for (int i = 0; i < fields; ++i)
+ {
+ dptr = XbusUtility_readU16((uint16_t*)&conf->dtype, dptr);
+ dptr = XbusUtility_readU16(&conf->freq, dptr);
+ ++conf;
+ }
+ }
+ else
+ {
+ parser->currentMessage.data = NULL;
+ }
+ }
+ break;
+
default:
assert(!canParseMessagePayload(parser->currentMessage.mid));
break;