Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
59 #define WIRELESSSUN_CMD_HELP "help" // help - disp help
60 #define WIRELESSSUN_CMD_VERS "vers" // vers - disp firmware version string
61 #define WIRELESSSUN_CMD_VERNUM "vernum" // vernum - disp firmware version number
62 #define WIRELESSSUN_CMD_RESET "reset" // reset [sec] execute to reset board
63 #define WIRELESSSUN_CMD_SLEEP "sleep" // sleep - execute to turn system sleep
64 #define WIRELESSSUN_CMD_ECHO "echo" // echo [0|1] - set/disp terminal echo
65 #define WIRELESSSUN_CMD_JSON "json" // json [0|1] - set/disp json command mode
66 #define WIRELESSSUN_CMD_MODE "mode" // mode [profile] - set/disp profile mode (0:NONE 1:FAN)
67 #define WIRELESSSUN_CMD_CHRATE "chrate" // chrate [rate] - disp parameter radio frequency rate (Kbps)
68 #define WIRELESSSUN_CMD_CHAN "chan" // chan [low] [high] - set/disp radio channel range
69 #define WIRELESSSUN_CMD_RCCAL "rccal" // rccal [rssi] - set/disp RSSI threshold of CCA
70 #define WIRELESSSUN_CMD_MAC "mac" // mac - disp MAC address
71 #define WIRELESSSUN_CMD_MACF "macf" // macf [allow|deny|del|clr] [mac] - set/disp MAC filtering table
72 #define WIRELESSSUN_CMD_MTXCTL "mtxctl" // mtxctl [0|1] - disp to control MAC TX//time
73 #define WIRELESSSUN_CMD_PAN "pan" // pan [id] - set/disp PAN ID
74 #define WIRELESSSUN_CMD_NETNAME "netname" // netname [name] - set/disp network name
75 #define WIRELESSSUN_CMD_IP "ip" // ip [ADDR] - set/disp self IPv6 address
76 #define WIRELESSSUN_CMD_INIT "init" // init [role] - disp/execute to start/stop node's role <role> 0:stop 1:BORDER 2:ROUTER 3:LEAF
77 #define WIRELESSSUN_CMD_ATSTART "atstart" // atstart [role] - set/disp auto//starting role
78 #define WIRELESSSUN_CMD_TCPCON "tcpcon" // tcpcon <ADDR> [port] - set/execute to connect TCP port
79 #define WIRELESSSUN_CMD_TCPDIS "tcpdis" // tcpdis <ADDR> [port] - set/execute to disconnect TCP port
80 #define WIRELESSSUN_CMD_LEASEIP "leaseip" // leaseip [MAC|del|clr] [ADDR] - set/disp fixed leasing address
81 #define WIRELESSSUN_CMD_LEASERNG "leaserng" // leaserng [num] - set/disp range of leasing address by DHCPv6 server
82 #define WIRELESSSUN_CMD_STAT "stat" // stat - disp system status
83 #define WIRELESSSUN_CMD_RSTAT "rstat" // rstat - disp radio status
84 #define WIRELESSSUN_CMD_MSTAT "mstat" // mstat - disp MAC statistics
85 #define WIRELESSSUN_CMD_FSTAT "fstat" // fstat - disp FAN state
86 #define WIRELESSSUN_CMD_CHCONFIG "chconfig" // chconfig - disp radio channel configuration
87 #define WIRELESSSUN_CMD_CHCUR "chcur" // chcur - disp currrent radio channel number
88 #define WIRELESSSUN_CMD_MTXAVL "mtxavl" // mtxavl - disp available bytes in MAC-TX limitation
89 #define WIRELESSSUN_CMD_FMSECKEY "fmseckey" // fmseckey - disp MAC Security KEY for FAN
90 #define WIRELESSSUN_CMD_NEBR "nebr" // nebr [del|clr] [ADDR] - set/disp neighbors
91 #define WIRELESSSUN_CMD_PARENT "parent" // parent - disp current parent address
92 #define WIRELESSSUN_CMD_RPLINF "rplinf" // rplinf - disp RPL information
93 #define WIRELESSSUN_CMD_TCPSTAT "tcpstat" // tcpstat - disp TCP stat
94 #define WIRELESSSUN_CMD_RPLSR "rplsr" // rplsr [del|clr] [ADDR] - disp RPL Source Route
95 #define WIRELESSSUN_CMD_LEASED "leased" // leased [del|clr] [ADDR] - set/disp leased address from DHCPv6 server
96 #define WIRELESSSUN_CMD_TCPS "tcps" // tcps <ADDR> [port] <data> - send TCP data
97 #define WIRELESSSUN_CMD_UDPS "udps" // udps <ADDR> [port] <data> - send UDP data
98 #define WIRELESSSUN_CMD_UDPST "udpst" // udpst <ADDR> [port] <text> - send UDP text data
99 #define WIRELESSSUN_CMD_PING "ping" // ping <start/stop/state/-> <ADDR>< [sz] [sec] [cnt] - send ping packet
100 #define WIRELESSSUN_CMD_TCPOPTS "tcpopts" // tcpopts [opt] [port|enable] - set/disp TCP options
101 #define WIRELESSSUN_CMD_UDPOPTS "udpopts" // udpopts [opt] [port|enable] - set/disp UDP options
102 #define WIRELESSSUN_CMD_RMTCMD "rmtcmd" // rmtcmd <ADDR> <cmd> [arg1] [arg2] ... - send remote command
103 #define WIRELESSSUN_CMD_RMTOPTS "rmtopts" // rmtopts [opt] [enable] - set/disp RMTCTL options
104 #define WIRELESSSUN_CMD_RFEC "rfec" // rfec [0|1] - set/disp radio FEC mode
105 #define WIRELESSSUN_CMD_RANTSW "rantsw" // rantsw [num] - set/disp anntena switch selection <num> 0:diversity 1<= : antenna number
106 #define WIRELESSSUN_CMD_FNODE "fnode" // fnode [del|clr] [ADDR] - set/disp FAN connect node
107 #define WIRELESSSUN_CMD_AUTH "auth" // auth [0|1] - set/disp authentication mode
108 #define WIRELESSSUN_CMD_NODEF "nodef" // nodef [allow|deny|del|clr] [mac] - set/disp node filtering table
109 #define WIRELESSSUN_CMD_PARAM "param" // param - disp parameters
110 #define WIRELESSSUN_CMD_SAVE "save" // save - save parameters
111 #define WIRELESSSUN_CMD_CLEAR "clear" // clear - clear parameters
112 #define WIRELESSSUN_CMD_SVRST "svrst" // svrst [reset_delay_sec] - save parameters and reset
113 #define WIRELESSSUN_CMD_CLRST "clrst" // clrst [reset_delay_sec] - clear parameters and reset
114 #define WIRELESSSUN_CMD_PROMPT_SIGN "\r\n>" // Command prompt sign
115 #define WIRELESSSUN_CMD_DELIMITER " " // Command parameters delimiter
116 #define WIRELESSSUN_RSP_UDPR "udpr" // Command parameters delimiter
122 #define WIRELESSSUN_RSP_UDPR "udpr"
123 #define WIRELESSSUN_RSP_TCPR "tcpr"
129 #define WIRELESSSUN_DEVICE_ROLE_STOP "0"
130 #define WIRELESSSUN_DEVICE_ROLE_BORDER "1"
131 #define WIRELESSSUN_DEVICE_ROLE_ROUTER "2"
132 #define WIRELESSSUN_DEVICE_ROLE_LEAF "3"
138 #define WIRELESSSUN_DEFAULT_PORT "3610"
145 #define TX_DRV_BUFFER_SIZE 100
146 #define RX_DRV_BUFFER_SIZE 600
164 #define WIRELESSSUN_MAP_MIKROBUS( cfg, mikrobus ) \
165 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
166 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
167 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
168 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
169 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_INT );
360 #endif // WIRELESSSUN_H
wirelesssun_return_value_t
Wireless SUN Click return value data.
Definition: wirelesssun.h:225
void wirelesssun_send_cmd_with_parameter(wirelesssun_t *ctx, char *cmd, char *param_buf)
Wireless SUN send cmd function.
uart_stop_bits_t stop_bit
Definition: wirelesssun.h:216
uint8_t wirelesssun_get_rts_pin(wirelesssun_t *ctx)
Wireless SUN get rts pin function.
void wirelesssun_send_cmd(wirelesssun_t *ctx, char *cmd)
Wireless SUN send cmd function.
void wirelesssun_reset_device(wirelesssun_t *ctx)
Wireless SUN reset device function.
pin_name_t tx_pin
Definition: wirelesssun.h:204
@ WIRELESSSUN_ERROR_TIMEOUT
Definition: wirelesssun.h:228
uart_t uart
Definition: wirelesssun.h:188
@ WIRELESSSUN_ERROR
Definition: wirelesssun.h:227
#define TX_DRV_BUFFER_SIZE
Wireless SUN driver buffer size.
Definition: wirelesssun.h:145
pin_name_t cts
Definition: wirelesssun.h:208
pin_name_t rx_pin
Definition: wirelesssun.h:203
bool uart_blocking
Definition: wirelesssun.h:213
digital_out_t rst
Definition: wirelesssun.h:181
void wirelesssun_set_rst_pin(wirelesssun_t *ctx, uint8_t state)
Wireless SUN set rst pin function.
void wirelesssun_cfg_setup(wirelesssun_cfg_t *cfg)
Wireless SUN configuration object setup function.
pin_name_t rts
Definition: wirelesssun.h:209
pin_name_t rst
Definition: wirelesssun.h:207
err_t wirelesssun_init(wirelesssun_t *ctx, wirelesssun_cfg_t *cfg)
Wireless SUN initialization function.
#define RX_DRV_BUFFER_SIZE
Definition: wirelesssun.h:146
Wireless SUN Click context object.
Definition: wirelesssun.h:179
uart_parity_t parity_bit
Definition: wirelesssun.h:215
Wireless SUN Click configuration object.
Definition: wirelesssun.h:201
digital_out_t cts
Definition: wirelesssun.h:182
uart_data_bits_t data_bit
Definition: wirelesssun.h:214
digital_in_t rts
Definition: wirelesssun.h:185
@ WIRELESSSUN_OK
Definition: wirelesssun.h:226
uint32_t baud_rate
Definition: wirelesssun.h:212
err_t wirelesssun_generic_write(wirelesssun_t *ctx, char *data_in, uint16_t len)
Wireless SUN data writing function.
void wirelesssun_set_cts_pin(wirelesssun_t *ctx, uint8_t state)
Wireless SUN set cts pin function.
err_t wirelesssun_generic_read(wirelesssun_t *ctx, char *data_out, uint16_t len)
Wireless SUN data reading function.