Hi all, I am having a hard time understanding how the "ieee802154_set_frame_hdr" function, found in this link<https://github.com/RIOT-OS/RIOT/blob/master/sys/net/link_layer/ieee802154/ieee802154.c>, sets the Frame Control Field (FCF) for 802.15.4 frame header. Following the IEEE 802.15.4 FCF format, frame version should be at the 12-13th bit of the 2-byte FCF, while in the function code, the frame version was set at the 11th bit. Does it uses different FCF format or am I missing something?
This is the first part of the function: size_t ieee802154_set_frame_hdr(uint8_t *buf, const uint8_t *src, size_t src_len, const uint8_t *dst, size_t dst_len, le_uint16_t src_pan, le_uint16_t dst_pan, uint8_t flags, uint8_t seq) { int pos = 3; /* 0-1: FCS, 2: seq */ uint8_t type = (flags & IEEE802154_FCF_TYPE_MASK); buf[0] = flags; buf[1] = IEEE802154_FCF_VERS_V1; // IEEE802154_FCF_VERS_V1 is defined as 0x10 if (((src_len != 0) && (src == NULL)) || ((dst_len != 0) && (dst == NULL))) { return 0; } ... ... The first two bytes of the *buf represent the FCF. I would appreciate it if someone explains or provides the FCF format that RIOT-OS uses. Thank you, Ahed
_______________________________________________ devel mailing list devel@riot-os.org https://lists.riot-os.org/mailman/listinfo/devel