18 #include "../../../src/ISComm.h" 40 #define XBEE_APPLY_CHANGES "AC" 41 #define XBEE_SOFTWARE_RESET "FR" 42 #define XBEE_RESTORE_DEFAULTS "RE" 43 #define XBEE_WRITE_VALUES "WR" 44 #define XBEE_EXIT_COMMAND_MODE "CN" 47 #define XBEE_PREAMBLE_ID "HP" 48 #define XBEE_NETWORK_ID "ID" 49 #define XBEE_BCAST_MULTITX "MT" 50 #define XBEE_UCAST_RETRIES "RR" 51 #define XBEE_TRANSMIT_OPTIONS "TO" 52 #define XBEE_TX_POWER_LEVEL "PL" 53 #define XBEE_BAUD_RATE "BD" 54 #define XBEE_PACKETIZATION_TO "RO" 55 #define XBEE_API_ENABLE "AP" 56 #define XBEE_SLEEP_MODE "SM" 59 #define XBEE_RSSI = "DB" 65 uint8_t preamble_id = 23;
66 uint16_t network_id = 45;
67 uint8_t bcast_multi_tx = 0;
68 uint8_t ucast_retries = 0;
69 uint8_t transmit_options = 0x40;
70 uint8_t tx_power_level = 2;
71 uint8_t baud_rate = 7;
72 uint8_t packetization_to = 0;
73 uint8_t api_enable = 1;
74 uint8_t sleep_options = 1;
116 cmd = string(
"AT") + cmd +
"\r";
152 default:
return true;
189 #define BUF_SIZE 256 //USB CDC buffer size is 320 198 while(buf[0] == 0x4F && len < 3)
202 if(memcmp(reinterpret_cast<char *>(buf),
"OK\r", 3) == 0)
210 uint8_t lsb = buf[2];
215 s_last_api_command[0] = buf[5];
216 s_last_api_command[1] = buf[6];
217 s_last_api_command[2] = buf[7];
219 if(buf[5] == (
'D') && buf[6] == (
'B'))
221 xbee_read.
rssi = buf[8];
xbee_diff_commands xbee_diff
int serSetBaudRate(int serialNum, int baudrate)
Change USART baudrate. 0 on success, -1 on failure.
void com_bridge_smart_forward(uint32_t srcPort, uint32_t ledPin)
int comWrite(int serialNum, const unsigned char *buf, int size, uint32_t ledPin)
int xbee_runtime_mode(void)
static void xbee_receive(is_comm_instance_t *comm)
void xbee_step(is_comm_instance_t *comm)
#define XBEE_EXIT_COMMAND_MODE
xbee_read_commands xbee_read
void com_bridge_forward(uint32_t srcPort, uint8_t *buf, int len)
static void send_at_command(string cmd)
#define XBEE_WRITE_VALUES
#define XBEE_UCAST_RETRIES
#define XBEE_RESTORE_DEFAULTS
static bool send_next_at_command()
int comRead(int serialNum, unsigned char *buf, int bufSize, uint32_t ledPin)
#define XBEE_TRANSMIT_OPTIONS
evb_flash_cfg_t * g_flashCfg
Autogenerated API include file for the Atmel Software Framework (ASF)
#define XBEE_TX_POWER_LEVEL
#define XBEE_BCAST_MULTITX
static int s_at_command_idx