Library for using the LSR SiFlex/ProFlex RF modules with mbed.
Diff: LsrModule.cpp
- Revision:
- 4:2ac0b9a7f43a
- Parent:
- 3:8d794c196710
- Child:
- 6:b0445108f82f
--- a/LsrModule.cpp Mon Jul 25 17:03:28 2016 +0000 +++ b/LsrModule.cpp Mon Jul 25 18:01:26 2016 +0000 @@ -533,6 +533,31 @@ /** +* Sends message type 0x19 (Set RF Data Rate) to the module via UART communication. This will spark an ACK message +* from the module to the Arduino of type 0x98. Subscribing to 0x98 in your main application will allow you to parse +* the response data. See the description for SubscribeRxMsgCallback for more information. +* +*/ +void LsrModule::SetRfDataRateMsg(uint8_t u8RfDataRate ///< Data rate for module to use when communicating via radio: + ///< 0 = 1,200 bits/s + ///< 1 = 2,400 bits/s + ///< 2 = 4,800 bits/s + ///< 3 = 9,600 bits/s + ///< 4 = 19,200 bits/s + ///< 5 = 38,400 bits/s + ///< 6 = 57,600 bits/s + ///< 7 = 115,200 bits/s + ) +{ + if (u8RfDataRate <= LSR_MODULE_RF_DATA_RATE_MAX) + { + AddSerialMsgHeader(LSR_MODULE_SET_RF_DATA_RATE_MSG_TYPE, 6); + AddSerialByteToMsgBuffer(u8RfDataRate); + AddSerialMsgTrailer(); + } +} /*** End SetRfDataRateMsg ***/ + +/** * Sends message type 0x20 (Send Simple Short Address RF Data Packet) to the module via UART communication. * This will spark an ACK message from the module to the Arduino of type 0xA0. Subscribing to 0xA0 in * your main application will allow you to parse the response data. See the description for SubscribeRxMsgCallback