6LoWPAN: Add debug statements; Update configuration, need to specific 6LoWPAN compatible port numbers.

This commit is contained in:
Gregory Nutt
2017-06-20 10:37:32 -06:00
parent 68a2b84277
commit 6dafb4f532
6 changed files with 41 additions and 47 deletions
+2 -1
View File
@@ -82,7 +82,8 @@ Optimal 6LoWPAN Configuration
fe80 0000 0000 0000 0000 00ff fe00 MMMM 2-byte short address IEEE 48-bit MAC
fe80 0000 0000 0000 NNNN NNNN NNNN NNNN 8-byte extended address IEEE EUI-64
4. Compressable port numbers in the rangs 0xf0b0-0xf0bf
4. To be compressable, port numbers must be in the range 0xf0b0-0xf0bf,
hexadecimal. That is 61616-61631 decimal.
5. IOBs: Must be big enough to hold one IEEE802.15.4 frame (CONFIG_NET_6LOWPAN_FRAMELEN,
typically 127). There must be enough IOBs to decompose the largest IPv6
+2
View File
@@ -224,6 +224,8 @@ int sixlowpan_queue_frames(FAR struct ieee802154_driver_s *ieee,
#endif
int ret;
ninfo("buflen=%lu", (unsigned long)buflen);
/* Initialize global data. Locking the network guarantees that we have
* exclusive use of the global values for intermediate calculations.
*/
+9 -5
View File
@@ -182,7 +182,7 @@ static uint16_t send_interrupt(FAR struct net_driver_s *dev,
if ((flags & NETDEV_DOWN) != 0)
{
ninfo("Device is down\n");
nwarn("WARNING: Device is down\n");
sinfo->s_result = -ENOTCONN;
goto end_wait;
}
@@ -279,6 +279,8 @@ int sixlowpan_send(FAR struct net_driver_s *dev,
{
struct sixlowpan_send_s sinfo;
ninfo("len=%lu timeout=%u\n", (unsigned long)len, timeout);
/* Initialize the send state structure */
sem_init(&sinfo.s_waitsem, 0, 0);
@@ -301,16 +303,16 @@ int sixlowpan_send(FAR struct net_driver_s *dev,
* device related events, no connect-related events.
*/
sinfo.s_cb = devif_callback_alloc(dev, list);
sinfo.s_cb = devif_callback_alloc(dev, list);
if (sinfo.s_cb != NULL)
{
int ret;
/* Set up the callback in the connection */
sinfo.s_cb->flags = (NETDEV_DOWN | WPAN_POLL);
sinfo.s_cb->priv = (FAR void *)&sinfo;
sinfo.s_cb->event = send_interrupt;
sinfo.s_cb->flags = (NETDEV_DOWN | WPAN_POLL);
sinfo.s_cb->priv = (FAR void *)&sinfo;
sinfo.s_cb->event = send_interrupt;
/* Notify the IEEE802.15.4 MAC that we have data to send. */
@@ -322,6 +324,8 @@ int sixlowpan_send(FAR struct net_driver_s *dev,
* automatically re-enabled when the task restarts.
*/
ninfo("Wait for send complete\n");
ret = net_lockedwait(&sinfo.s_waitsem);
if (ret < 0)
{