Program that uses the QuickStart Library to interface a SmartMesh IP mote: Connects to the default network and starts publishing a random walk value every 5 seconds.
Fork of QSL_SimplePublish by
QSL SimplePublish
SmartMesh IP QuickStart Library
- GitHub repository
- Current release used: REL-1.0.2.2
- Documentation
- Discussion
sm_qsl/dn_defaults.h@9:f723949a18b7, 2016-11-04 (annotated)
- Committer:
- jhbr
- Date:
- Fri Nov 04 14:19:34 2016 +0000
- Revision:
- 9:f723949a18b7
- Parent:
- 1:89766ea2e99d
Deactivated DEBUG prints and updated mbed library to v128
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jhbr | 0:d3f5fdf2e6da | 1 | /* |
jhbr | 0:d3f5fdf2e6da | 2 | Copyright (c) 2016, Dust Networks. All rights reserved. |
jhbr | 0:d3f5fdf2e6da | 3 | |
jhbr | 0:d3f5fdf2e6da | 4 | Default values and common definitions for the QuickStart Library. |
jhbr | 0:d3f5fdf2e6da | 5 | |
jhbr | 0:d3f5fdf2e6da | 6 | \license See attached DN_LICENSE.txt. |
jhbr | 0:d3f5fdf2e6da | 7 | */ |
jhbr | 0:d3f5fdf2e6da | 8 | |
jhbr | 0:d3f5fdf2e6da | 9 | #ifndef DN_DEFAULTS_H |
jhbr | 0:d3f5fdf2e6da | 10 | #define DN_DEFAULTS_H |
jhbr | 0:d3f5fdf2e6da | 11 | |
jhbr | 0:d3f5fdf2e6da | 12 | #include "dn_common.h" |
jhbr | 0:d3f5fdf2e6da | 13 | |
jhbr | 0:d3f5fdf2e6da | 14 | //=========================== defines ========================================= |
jhbr | 0:d3f5fdf2e6da | 15 | |
jhbr | 0:d3f5fdf2e6da | 16 | #define DN_IPv6ADDR_LEN 16 |
jhbr | 0:d3f5fdf2e6da | 17 | #define DN_JOIN_KEY_LEN 16 |
jhbr | 0:d3f5fdf2e6da | 18 | |
jhbr | 0:d3f5fdf2e6da | 19 | static const uint8_t dn_default_joinKey[DN_JOIN_KEY_LEN] = { |
jhbr | 0:d3f5fdf2e6da | 20 | 0x44,0x55,0x53,0x54,0x4E,0x45,0x54,0x57, |
jhbr | 0:d3f5fdf2e6da | 21 | 0x4F,0x52,0x4B,0x53,0x52,0x4F,0x43,0x4B |
jhbr | 0:d3f5fdf2e6da | 22 | }; |
jhbr | 0:d3f5fdf2e6da | 23 | static const uint8_t dn_default_manager_ipv6Addr[DN_IPv6ADDR_LEN] = { |
jhbr | 0:d3f5fdf2e6da | 24 | 0xff,0x02,0x00,0x00,0x00,0x00,0x00,0x00, |
jhbr | 0:d3f5fdf2e6da | 25 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02 |
jhbr | 0:d3f5fdf2e6da | 26 | }; |
jhbr | 0:d3f5fdf2e6da | 27 | |
jhbr | 0:d3f5fdf2e6da | 28 | /* |
jhbr | 0:d3f5fdf2e6da | 29 | UDP ports in this range are most efficiently compressed inside the mesh, |
jhbr | 0:d3f5fdf2e6da | 30 | and should be used whenever possible to maximize usable payload. |
jhbr | 0:d3f5fdf2e6da | 31 | */ |
jhbr | 0:d3f5fdf2e6da | 32 | #define DN_WELL_KNOWN_PORT_1 0xf0b8 |
jhbr | 0:d3f5fdf2e6da | 33 | #define DN_WELL_KNOWN_PORT_2 0xf0b9 |
jhbr | 0:d3f5fdf2e6da | 34 | #define DN_WELL_KNOWN_PORT_3 0xf0ba |
jhbr | 0:d3f5fdf2e6da | 35 | #define DN_WELL_KNOWN_PORT_4 0xf0bb |
jhbr | 0:d3f5fdf2e6da | 36 | #define DN_WELL_KNOWN_PORT_5 0xf0bc |
jhbr | 0:d3f5fdf2e6da | 37 | #define DN_WELL_KNOWN_PORT_6 0xf0bd |
jhbr | 0:d3f5fdf2e6da | 38 | #define DN_WELL_KNOWN_PORT_7 0xf0be |
jhbr | 0:d3f5fdf2e6da | 39 | #define DN_WELL_KNOWN_PORT_8 0xf0bf |
jhbr | 0:d3f5fdf2e6da | 40 | |
jhbr | 0:d3f5fdf2e6da | 41 | /* |
jhbr | 0:d3f5fdf2e6da | 42 | The payload size limit varies based on the destination address and whether |
jhbr | 0:d3f5fdf2e6da | 43 | source and destination are set to one of the well-known ports. |
jhbr | 0:d3f5fdf2e6da | 44 | */ |
jhbr | 0:d3f5fdf2e6da | 45 | #define DN_PAYLOAD_SIZE_LIMIT_MNG_HIGH 90 |
jhbr | 0:d3f5fdf2e6da | 46 | #define DN_PAYLOAD_SIZE_LIMIT_MNG_MED 88 |
jhbr | 0:d3f5fdf2e6da | 47 | #define DN_PAYLOAD_SIZE_LIMIT_MNG_LOW 87 |
jhbr | 0:d3f5fdf2e6da | 48 | #define DN_PAYLOAD_SIZE_LIMIT_IP_HIGH 74 |
jhbr | 0:d3f5fdf2e6da | 49 | #define DN_PAYLOAD_SIZE_LIMIT_IP_MED 72 |
jhbr | 0:d3f5fdf2e6da | 50 | #define DN_PAYLOAD_SIZE_LIMIT_IP_LOW 71 |
jhbr | 0:d3f5fdf2e6da | 51 | |
jhbr | 0:d3f5fdf2e6da | 52 | /* |
jhbr | 0:d3f5fdf2e6da | 53 | This is not a valid network ID, but will instead cause the QSL to to take the |
jhbr | 0:d3f5fdf2e6da | 54 | mote through a promiscuous listen state to identify the ID of advertising |
jhbr | 0:d3f5fdf2e6da | 55 | networks, further attempting to join the first one found. |
jhbr | 0:d3f5fdf2e6da | 56 | */ |
jhbr | 0:d3f5fdf2e6da | 57 | #define DN_PROMISCUOUS_NET_ID 0xffff |
jhbr | 0:d3f5fdf2e6da | 58 | |
jhbr | 0:d3f5fdf2e6da | 59 | #define DN_DEFAULT_NET_ID 1229 |
jhbr | 0:d3f5fdf2e6da | 60 | #define DN_DEFAULT_JOIN_KEY (uint8_t*)dn_default_joinKey |
jhbr | 0:d3f5fdf2e6da | 61 | #define DN_DEFAULT_DEST_PORT DN_WELL_KNOWN_PORT_1 |
jhbr | 0:d3f5fdf2e6da | 62 | #define DN_DEFAULT_DEST_IP (uint8_t*)dn_default_manager_ipv6Addr |
jhbr | 0:d3f5fdf2e6da | 63 | #define DN_DEFAULT_SRC_PORT DN_WELL_KNOWN_PORT_1 |
jhbr | 0:d3f5fdf2e6da | 64 | #define DN_DEFAULT_PAYLOAD_SIZE_LIMIT DN_PAYLOAD_SIZE_LIMIT_MNG_HIGH |
jhbr | 0:d3f5fdf2e6da | 65 | #define DN_DEFAULT_SERVICE_MS 9000 // Base bandwidth provided by manager |
jhbr | 0:d3f5fdf2e6da | 66 | |
jhbr | 0:d3f5fdf2e6da | 67 | //=========================== typedef ========================================= |
jhbr | 0:d3f5fdf2e6da | 68 | |
jhbr | 0:d3f5fdf2e6da | 69 | //=========================== variables ======================================= |
jhbr | 0:d3f5fdf2e6da | 70 | |
jhbr | 0:d3f5fdf2e6da | 71 | //=========================== prototypes ====================================== |
jhbr | 0:d3f5fdf2e6da | 72 | |
jhbr | 0:d3f5fdf2e6da | 73 | #ifdef __cplusplus |
jhbr | 0:d3f5fdf2e6da | 74 | extern "C" |
jhbr | 0:d3f5fdf2e6da | 75 | { |
jhbr | 0:d3f5fdf2e6da | 76 | #endif |
jhbr | 0:d3f5fdf2e6da | 77 | |
jhbr | 0:d3f5fdf2e6da | 78 | |
jhbr | 0:d3f5fdf2e6da | 79 | |
jhbr | 0:d3f5fdf2e6da | 80 | |
jhbr | 0:d3f5fdf2e6da | 81 | #ifdef __cplusplus |
jhbr | 0:d3f5fdf2e6da | 82 | } |
jhbr | 0:d3f5fdf2e6da | 83 | #endif |
jhbr | 0:d3f5fdf2e6da | 84 | |
jhbr | 0:d3f5fdf2e6da | 85 | #endif /* DN_DEFAULTS_H */ |
jhbr | 0:d3f5fdf2e6da | 86 | |
jhbr | 0:d3f5fdf2e6da | 87 |