improve nativenet send functions return type

This commit is contained in:
Ludwig Ortmann 2013-12-21 16:56:42 +01:00
parent 04bedb8a62
commit ef315ed662
3 changed files with 3 additions and 3 deletions

View File

@ -40,4 +40,5 @@ struct rx_buffer_s {
extern struct rx_buffer_s _nativenet_rx_buffer[RX_BUF_SIZE];
void _nativenet_handle_packet(radio_packet_t *packet);
int8_t send_buf(radio_packet_t *packet);
#endif /* NATIVENET_INTERNAL_H */

View File

@ -31,7 +31,6 @@
* On OSX a name has to be provided.
*/
int tap_init(char *name);
int send_buf(radio_packet_t *packet);
extern int _native_tap_fd;
extern unsigned char _native_tap_mac[ETHER_ADDR_LEN];

View File

@ -162,7 +162,7 @@ int _native_marshall_ethernet(uint8_t *framebuf, radio_packet_t *packet)
return data_len + ETHER_HDR_LEN;
}
int send_buf(radio_packet_t *packet)
int8_t send_buf(radio_packet_t *packet)
{
uint8_t buf[TAP_BUFFER_LENGTH];
int nsent, to_send;
@ -178,7 +178,7 @@ int send_buf(radio_packet_t *packet)
warn("write");
return -1;
}
return 0;
return (nsent > INT8_MAX ? INT8_MAX : nsent);
}
int tap_init(char *name)