SmartMesh QSL for STM32F4 version

Fork of COG-AD4050_QSL by APS Lab

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers dn_defaults.h Source File

dn_defaults.h

00001 /*
00002 Copyright (c) 2016, Dust Networks. All rights reserved.
00003 
00004 Default values and common definitions for the QuickStart Library.
00005 
00006 \license See attached DN_LICENSE.txt.
00007 */
00008 
00009 #ifndef DN_DEFAULTS_H
00010 #define DN_DEFAULTS_H
00011 
00012 #include "dn_common.h"
00013 
00014 //=========================== defines =========================================
00015 
00016 #define DN_IPv6ADDR_LEN 16
00017 #define DN_JOIN_KEY_LEN 16
00018 
00019 static const uint8_t dn_default_joinKey[DN_JOIN_KEY_LEN] = {
00020    0x44,0x55,0x53,0x54,0x4E,0x45,0x54,0x57,
00021    0x4F,0x52,0x4B,0x53,0x52,0x4F,0x43,0x4B
00022 };
00023 static const uint8_t dn_default_manager_ipv6Addr[DN_IPv6ADDR_LEN] = {
00024    0xff,0x02,0x00,0x00,0x00,0x00,0x00,0x00,
00025    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02
00026 };
00027 
00028 /*
00029  UDP ports in this range are most efficiently compressed inside the mesh,
00030  and should be used whenever possible to maximize usable payload.
00031  */
00032 #define DN_WELL_KNOWN_PORT_1    0xf0b8
00033 #define DN_WELL_KNOWN_PORT_2    0xf0b9
00034 #define DN_WELL_KNOWN_PORT_3    0xf0ba
00035 #define DN_WELL_KNOWN_PORT_4    0xf0bb
00036 #define DN_WELL_KNOWN_PORT_5    0xf0bc
00037 #define DN_WELL_KNOWN_PORT_6    0xf0bd
00038 #define DN_WELL_KNOWN_PORT_7    0xf0be
00039 #define DN_WELL_KNOWN_PORT_8    0xf0bf
00040 
00041 /*
00042  The payload size limit varies based on the destination address and whether
00043  source and destination are set to one of the well-known ports.
00044  */
00045 #define DN_PAYLOAD_SIZE_LIMIT_MNG_HIGH  90
00046 #define DN_PAYLOAD_SIZE_LIMIT_MNG_MED   88
00047 #define DN_PAYLOAD_SIZE_LIMIT_MNG_LOW   87
00048 #define DN_PAYLOAD_SIZE_LIMIT_IP_HIGH   74
00049 #define DN_PAYLOAD_SIZE_LIMIT_IP_MED    72
00050 #define DN_PAYLOAD_SIZE_LIMIT_IP_LOW    71
00051 
00052 /*
00053  This is not a valid network ID, but will instead cause the QSL to to take the
00054  mote through a promiscuous listen state to identify the ID of advertising
00055  networks, further attempting to join the first one found.
00056  */
00057 #define DN_PROMISCUOUS_NET_ID   0xffff
00058 
00059 #define DN_DEFAULT_NET_ID               1229
00060 #define DN_DEFAULT_JOIN_KEY             (uint8_t*)dn_default_joinKey
00061 #define DN_DEFAULT_DEST_PORT            DN_WELL_KNOWN_PORT_1
00062 #define DN_DEFAULT_DEST_IP              (uint8_t*)dn_default_manager_ipv6Addr
00063 #define DN_DEFAULT_SRC_PORT             DN_WELL_KNOWN_PORT_1
00064 #define DN_DEFAULT_PAYLOAD_SIZE_LIMIT   DN_PAYLOAD_SIZE_LIMIT_MNG_HIGH
00065 #define DN_DEFAULT_SERVICE_MS           9000 // Base bandwidth provided by manager
00066 
00067 //=========================== typedef =========================================
00068 
00069 //=========================== variables =======================================
00070 
00071 //=========================== prototypes ======================================
00072 
00073 #ifdef __cplusplus
00074 extern "C"
00075 {
00076 #endif
00077 
00078 
00079 
00080 
00081 #ifdef __cplusplus
00082 }
00083 #endif
00084 
00085 #endif /* DN_DEFAULTS_H */
00086 
00087