Revision 1604
wireless: software retransmit done. serial functions moved to xbee.c
wireless.c | ||
---|---|---|
93 | 93 |
// reset packet handler array |
94 | 94 |
memset(wl_packet_handlers, sizeof(PacketGroupHandler)*MAX_PACKET_GROUPS, 0); |
95 | 95 |
|
96 |
// TODO need pass termination error from lower level functions |
|
97 |
xbee_terminate(); |
|
98 |
// if(TERMINATE FAILS) { |
|
99 |
// return WL_ERROR_TERMINATION_FAILED |
|
100 |
// } |
|
96 |
if(xbee_terminate() != WL_SUCCESS) { |
|
97 |
return WL_ERROR_TERMINATION_FAILED |
|
98 |
} |
|
101 | 99 |
|
102 | 100 |
return WL_SUCCESS; |
103 | 101 |
} |
... | ... | |
118 | 116 |
return WL_ERROR_LIBRARY_NOT_INITD; |
119 | 117 |
} |
120 | 118 |
|
121 |
// packet group number exceeds available packets groups |
|
122 |
if(group >= MAX_PACKET_GROUPS) { |
|
119 |
// packet group number exceeds available packets groups |
|
120 |
// or packet group handler already exists |
|
121 |
if(group >= MAX_PACKET_GROUPS || group == 0 |
|
122 |
|| wl_packet_handlers[group].FUNC != NULL) { |
|
123 | 123 |
return WL_ERROR_FAILED_REGISTRATION; |
124 | 124 |
} |
125 |
|
|
126 |
// packet group handler already exists, user needs to unregister first |
|
127 |
if(wl_packet_handlers[group].FUNC != NULL) { |
|
128 |
return WL_ERROR_FAILED_REGISTRATION; |
|
129 |
} |
|
130 | 125 |
|
131 | 126 |
// save packet handler function pointer and priority |
132 | 127 |
wl_packet_handlers[group].FUNC = FUNC; |
Also available in: Unified diff