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