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