c99-arduino-coap-msgpack

Slyftlet details

This slyftlet creates a basic CoAP API interface capable of handling msgpack messages. Code can be compiled for targets of the Arduino platform.

Characteristics

Language

C99, C++. Core protocol and data parsing code is C99, an adapter for handling Arduinos UDP messages is C++

Platform

Arduino

Protocol

CoAP. Uses the microcoap Implementation https://github.com/1248/microcoap

Data Handling

MessagePack. Uses https://github.com/ludocode/mpack

Inputs

Uses JSON-Schema to describe message objects.

Uses RAML 0.8 to describe CoAP API endpoints.

The configuration file is expressed in JSON.

Configuration

This slyftlet expects a JSON configuration file named c99-arduino-coap-msgpack.json as a project asset.

Available settings

  • c_filename_prefix string This prefix is prepended to every header and source filename
  • c_define_prefix string This prefix is prepended to the #ifndef at the beginning of every header
  • c_identifier_prefix string This prefix is prepended to every C identifier (i.e. function names etc.)"
  • source_file_extension string File extension for source files. Default: c
  • header_file_extension string File extension for header files. Default: h
  • include_file string Header file to #include at start of each source file (default: application.h). Optional
  • includefile_microcoap string Name and directory of microcoap include file. Default: microcoap/coap.h ; Optional
  • coap_buffer_maxsize number Size of Byte-Buffer that is put on stack when parsing/serializing coap messages. Default: 512 bytes

JSON Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "slyftlet-c99-generic-msgpack-config",
  "title": "Configuration Schema",
  "type": "object",
  "properties": {
    "c_filename_prefix": {
      "type": "string",
      "description": "This prefix is prepended to every header and source filename",
      "maxLength": 16
    },
    "c_define_prefix": {
      "type": "string",
      "description": "This prefix is prepended to the #ifndef at the beginning of every header",
      "maxLength": 32
    },
    "c_identifier_prefix": {
      "type": "string",
      "description": "This prefix is prepended to every C identifier (i.e. function names etc.)",
      "maxLength": 32
    },
    "source_file_extension": {
      "type": "string",
      "description": "File extension for source files. Default: c",
      "maxLength": 8
    },
    "header_file_extension": {
      "type": "string",
      "description": "File extension for header files. Default: h",
      "maxLength": 8
    },
    "include_file": {
      "type": "string",
      "description": "Header file to #include at start of each source file (default: application.h). Optional",
      "maxLength": 128
    },
    "includefile_microcoap": {
      "type": "string",
      "description": "Name and directory of microcoap include file. Default: microcoap/coap.h ; Optional",
      "maxLength": 128
    },
    "coap_buffer_maxsize": {
      "type": "number",
      "description": "Size of Byte-Buffer that is put on stack when parsing/serializing coap messages. Default: 512 bytes"
    }
  },
  "additionalProperties": false,
  "required": [
    "c_define_prefix",
    "c_identifier_prefix"
  ]
}