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: MTS-Serial libmDot mbed-rtos mbed
Fork of mDot_USB_AT_firmware by
CmdJoinByteOrder.cpp
00001 #include "CmdJoinByteOrder.h" 00002 00003 CmdJoinByteOrder::CmdJoinByteOrder(mDot* dot, mts::MTSSerial& serial) : 00004 Command(dot, "Join Byte Order", "AT+JBO", "Send EUI's in join request with configured byte ordering (0:LSB,1:MSB)"), _serial(serial) 00005 { 00006 _help = std::string(text()) + ": " + std::string(desc()); 00007 _usage = "(0:LSB,1:MSB)"; 00008 _queryable = true; 00009 } 00010 00011 uint32_t CmdJoinByteOrder::action(std::vector<std::string> args) 00012 { 00013 if (args.size() == 1) 00014 { 00015 if (_dot->getVerbose()) 00016 _serial.writef("Join Byte Order: "); 00017 00018 _serial.writef("%d\r\n", _dot->getJoinByteOrder()); 00019 } 00020 else if (args.size() == 2) 00021 { 00022 int32_t code; 00023 mDot::JoinByteOrder order = mDot::LSB; 00024 00025 if (args[1] == "1") 00026 order = mDot::MSB; 00027 00028 if ((code = _dot->setJoinByteOrder(order)) != mDot::MDOT_OK) 00029 { 00030 00031 setErrorMessage(_dot->getLastError());; 00032 return 1; 00033 } 00034 } 00035 00036 return 0; 00037 } 00038 00039 bool CmdJoinByteOrder::verify(std::vector<std::string> args) 00040 { 00041 if (args.size() == 1) 00042 return true; 00043 00044 if (args.size() == 2) 00045 { 00046 if (args[1] != "0" && args[1] != "1") { 00047 setErrorMessage("Invalid argument"); 00048 return false; 00049 } 00050 00051 return true; 00052 } 00053 00054 setErrorMessage("Invalid arguments"); 00055 return false; 00056 }
Generated on Tue Jul 12 2022 20:37:29 by
1.7.2
