1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2026-01-01 01:41:18 +01:00

net_if: alternative approach for swapping the byte order

This commit is contained in:
Oleg Hahm 2014-11-05 16:11:58 +01:00
parent 8ab6e691d0
commit ac3519d46a

View File

@ -335,7 +335,8 @@ int net_if_send_packet(int if_id, uint16_t target, const void *payload,
p.frame.fcf.frame_pend = 0;
p.frame.dest_pan_id = net_if_get_pan_id(if_id);
memcpy(p.frame.dest_addr, &target, 2);
uint16_t target_h = NTOHS(target);
memcpy(p.frame.dest_addr, &target_h, 2);
response = net_if_transceiver_get_set_handler(if_id, SND_PKT, (void *)&p);
}
else {
@ -378,7 +379,8 @@ int net_if_send_packet_long(int if_id, net_if_eui64_t *target,
p.frame.fcf.frame_type = 1;
p.frame.fcf.frame_pend = 0;
p.frame.dest_pan_id = net_if_get_pan_id(if_id);
memcpy(p.frame.dest_addr, target, 8);
uint64_t target_h = NTOHLL(target->uint64);
memcpy(p.frame.dest_addr, &target_h, 8);
response = net_if_transceiver_get_set_handler(if_id, SND_PKT, (void *)&p);
}
else {