Ejemplo n.º 1
0
/* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.2.9.2 at Wed Apr  6 22:59:19 2016. */

#include "storage.pb.h"



const pb_field_t Storage_fields[10] = {
    PB_FIELD2(  1, UINT32  , REQUIRED, STATIC  , FIRST, Storage, version, version, 0),
    PB_FIELD2(  2, MESSAGE , OPTIONAL, STATIC  , OTHER, Storage, node, version, &HDNodeType_fields),
    PB_FIELD2(  3, STRING  , OPTIONAL, STATIC  , OTHER, Storage, mnemonic, node, 0),
    PB_FIELD2(  4, BOOL    , OPTIONAL, STATIC  , OTHER, Storage, passphrase_protection, mnemonic, 0),
    PB_FIELD2(  5, UINT32  , OPTIONAL, STATIC  , OTHER, Storage, pin_failed_attempts, passphrase_protection, 0),
    PB_FIELD2(  6, STRING  , OPTIONAL, STATIC  , OTHER, Storage, pin, pin_failed_attempts, 0),
    PB_FIELD2(  7, STRING  , OPTIONAL, STATIC  , OTHER, Storage, language, pin, 0),
    PB_FIELD2(  8, STRING  , OPTIONAL, STATIC  , OTHER, Storage, label, language, 0),
    PB_FIELD2(  9, BOOL    , OPTIONAL, STATIC  , OTHER, Storage, imported, label, 0),
    PB_LAST_FIELD
};


/* Check that field information fits in pb_field_t */
#if !defined(PB_FIELD_32BIT)
/* If you get an error here, it means that you need to define PB_FIELD_32BIT
 * compile-time option. You can do that in pb.h or on compiler command line.
 * 
 * The reason you need to do this is that some of your messages contain tag
 * numbers or field sizes that are larger than what can fit in 8 or 16 bit
 * field descriptors.
 */
STATIC_ASSERT((pb_membersize(Storage, node) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_Storage)
Ejemplo n.º 2
0
/* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.2.9.2 at Wed Jun  8 17:18:23 2016. */

#include "types.pb.h"

const uint32_t CoinType_address_type_default = 0u;
const uint32_t CoinType_address_type_p2sh_default = 5u;
const uint32_t CoinType_address_type_p2wpkh_default = 6u;
const uint32_t CoinType_address_type_p2wsh_default = 10u;
const uint32_t TxInputType_sequence_default = 4294967295u;
const InputScriptType TxInputType_script_type_default = InputScriptType_SPENDADDRESS;
const uint32_t IdentityType_index_default = 0u;


const pb_field_t HDNodeType_fields[7] = {
    PB_FIELD2(  1, UINT32  , REQUIRED, STATIC  , FIRST, HDNodeType, depth, depth, 0),
    PB_FIELD2(  2, UINT32  , REQUIRED, STATIC  , OTHER, HDNodeType, fingerprint, depth, 0),
    PB_FIELD2(  3, UINT32  , REQUIRED, STATIC  , OTHER, HDNodeType, child_num, fingerprint, 0),
    PB_FIELD2(  4, BYTES   , REQUIRED, STATIC  , OTHER, HDNodeType, chain_code, child_num, 0),
    PB_FIELD2(  5, BYTES   , OPTIONAL, STATIC  , OTHER, HDNodeType, private_key, chain_code, 0),
    PB_FIELD2(  6, BYTES   , OPTIONAL, STATIC  , OTHER, HDNodeType, public_key, private_key, 0),
    PB_LAST_FIELD
};

const pb_field_t HDNodePathType_fields[3] = {
    PB_FIELD2(  1, MESSAGE , REQUIRED, STATIC  , FIRST, HDNodePathType, node, node, &HDNodeType_fields),
    PB_FIELD2(  2, UINT32  , REPEATED, STATIC  , OTHER, HDNodePathType, address_n, node, 0),
    PB_LAST_FIELD
};

const pb_field_t CoinType_fields[9] = {
Ejemplo n.º 3
0
const char LoadDevice_language_default[17] = "english";
const uint32_t ResetDevice_strength_default = 128u;
const char ResetDevice_language_default[17] = "english";
const char RecoveryDevice_language_default[17] = "english";
const char SignMessage_coin_name_default[17] = "Bitcoin";
const char EstimateTxSize_coin_name_default[17] = "Bitcoin";
const char SignTx_coin_name_default[17] = "Bitcoin";
const char SimpleSignTx_coin_name_default[17] = "Bitcoin";


const pb_field_t Initialize_fields[1] = {
    PB_LAST_FIELD
};

const pb_field_t Features_fields[16] = {
    PB_FIELD2(  1, STRING  , OPTIONAL, STATIC  , FIRST, Features, vendor, vendor, 0),
    PB_FIELD2(  2, UINT32  , OPTIONAL, STATIC  , OTHER, Features, major_version, vendor, 0),
    PB_FIELD2(  3, UINT32  , OPTIONAL, STATIC  , OTHER, Features, minor_version, major_version, 0),
    PB_FIELD2(  4, UINT32  , OPTIONAL, STATIC  , OTHER, Features, patch_version, minor_version, 0),
    PB_FIELD2(  5, BOOL    , OPTIONAL, STATIC  , OTHER, Features, bootloader_mode, patch_version, 0),
    PB_FIELD2(  6, STRING  , OPTIONAL, STATIC  , OTHER, Features, device_id, bootloader_mode, 0),
    PB_FIELD2(  7, BOOL    , OPTIONAL, STATIC  , OTHER, Features, pin_protection, device_id, 0),
    PB_FIELD2(  8, BOOL    , OPTIONAL, STATIC  , OTHER, Features, passphrase_protection, pin_protection, 0),
    PB_FIELD2(  9, STRING  , OPTIONAL, STATIC  , OTHER, Features, language, passphrase_protection, 0),
    PB_FIELD2( 10, STRING  , OPTIONAL, STATIC  , OTHER, Features, label, language, 0),
    PB_FIELD2( 11, MESSAGE , REPEATED, STATIC  , OTHER, Features, coins, label, &CoinType_fields),
    PB_FIELD2( 12, BOOL    , OPTIONAL, STATIC  , OTHER, Features, initialized, coins, 0),
    PB_FIELD2( 13, BYTES   , OPTIONAL, STATIC  , OTHER, Features, revision, initialized, 0),
    PB_FIELD2( 14, BYTES   , OPTIONAL, STATIC  , OTHER, Features, bootloader_hash, revision, 0),
    PB_FIELD2( 15, BOOL    , OPTIONAL, STATIC  , OTHER, Features, imported, bootloader_hash, 0),
    PB_LAST_FIELD
Ejemplo n.º 4
0
/* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.2.4-dev at Thu Sep 26 18:56:18 2013. */

#include "messages.pb.h"



const pb_field_t Info_fields[2] = {
    PB_FIELD2(  1, STRING  , REQUIRED, STATIC, FIRST, Info, version, version, 0),
    PB_LAST_FIELD
};

const pb_field_t sensors_t_fields[6] = {
    PB_FIELD2(  1, UINT32  , REQUIRED, STATIC, FIRST, sensors_t, rpm, rpm, 0),
    PB_FIELD2(  2, UINT32  , REQUIRED, STATIC, OTHER, sensors_t, speed, rpm, 0),
    PB_FIELD2(  3, UINT32  , REQUIRED, STATIC, OTHER, sensors_t, strain_gauge, speed, 0),
    PB_FIELD2(  4, UINT32  , REQUIRED, STATIC, OTHER, sensors_t, tc_switch, strain_gauge, 0),
    PB_FIELD2(  5, UINT32  , REQUIRED, STATIC, OTHER, sensors_t, vbat, tc_switch, 0),
    PB_LAST_FIELD
};

const pb_field_t Settings_data_fields[12] = {
    PB_FIELD2(  1, UINT32  , REQUIRED, STATIC, FIRST, Settings_data, functions, functions, 0),
    PB_FIELD2(  2, UINT32  , REQUIRED, STATIC, OTHER, Settings_data, cut_type, functions, 0),
    PB_FIELD2(  3, UINT32  , REQUIRED, STATIC, OTHER, Settings_data, sensor_threshold, cut_type, 0),
    PB_FIELD2(  4, UINT32  , REQUIRED, STATIC, OTHER, Settings_data, slip_threshold, sensor_threshold, 0),
    PB_FIELD2(  5, UINT32  , REQUIRED, STATIC, OTHER, Settings_data, sensor_gain, slip_threshold, 0),
    PB_FIELD2(  6, UINT32  , REQUIRED, STATIC, OTHER, Settings_data, sensor_direction, sensor_gain, 0),
    PB_FIELD2(  7, UINT32  , REQUIRED, STATIC, OTHER, Settings_data, min_speed, sensor_direction, 0),
    PB_FIELD2(  8, UINT32  , REQUIRED, STATIC, OTHER, Settings_data, min_rpm, min_speed, 0),
    PB_FIELD2(  9, BYTES   , REQUIRED, STATIC, OTHER, Settings_data, gears_ratio, min_rpm, 0),
/** Device specification token for hardware configuration */
char* specificationToken = "2f5f26ed-ba66-48d7-a42f-40786b64b1f5";

/** Outbound MQTT topic */
char* outbound = "SiteWhere/input/protobuf";

/** Inbound custom command topic */
char Command1[COMMAND1_SIZE] = "SiteWhere/commands/MiCOKit-3288_000000";

/** Inbound system command topic */
char System1[SYSTEM1_SIZE] = "SiteWhere/system/MiCOKit-3288_000000";


const pb_field_t ArduinoCustom_RGB_fields[4] = {
  PB_FIELD2(  1, INT32  , REQUIRED, STATIC  , FIRST, ArduinoCustom_RGB_LED, rgbled_h, rgbled_h, 0),
  PB_FIELD2(  2, INT32  , REQUIRED, STATIC  , OTHER, ArduinoCustom_RGB_LED, rgbled_s, rgbled_h, 0),
  PB_FIELD2(  3, INT32  , REQUIRED, STATIC  , OTHER, ArduinoCustom_RGB_LED, rgbled_b, rgbled_s, 0),
  PB_LAST_FIELD
};

/** Handle the 'ping' command */
void handlePing(ArduinoCustom_ping ping, char* originator) {
  unsigned int len = 0;
  memset(buffer,0,300);
  if (len = sw_acknowledge(hardwareId, "Ping received.", buffer, sizeof(buffer), originator)) {
    mqtt_publish(&broker_mqtt,outbound,(char*)buffer,len,0);
  }
}

void handleMotor(ArduinoCustom_motor motor, char* originator) {
Ejemplo n.º 6
0
/* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.2.4-dev at Tue Oct  1 16:50:34 2013. */

#include "openxc.pb.h"



const pb_field_t openxc_VehicleMessage_fields[6] = {
    PB_FIELD2(  1, ENUM    , OPTIONAL, STATIC, FIRST, openxc_VehicleMessage, type, type, 0),
    PB_FIELD2(  2, MESSAGE , OPTIONAL, STATIC, OTHER, openxc_VehicleMessage, raw_message, type, &openxc_RawMessage_fields),
    PB_FIELD2(  3, MESSAGE , OPTIONAL, STATIC, OTHER, openxc_VehicleMessage, string_message, raw_message, &openxc_TranslatedStringMessage_fields),
    PB_FIELD2(  4, MESSAGE , OPTIONAL, STATIC, OTHER, openxc_VehicleMessage, numerical_message, string_message, &openxc_TranslatedNumericMessage_fields),
    PB_FIELD2(  5, MESSAGE , OPTIONAL, STATIC, OTHER, openxc_VehicleMessage, boolean_message, numerical_message, &openxc_TranslatedBooleanMessage_fields),
    PB_LAST_FIELD
};

const pb_field_t openxc_RawMessage_fields[4] = {
    PB_FIELD2(  1, INT32   , OPTIONAL, STATIC, FIRST, openxc_RawMessage, bus, bus, 0),
    PB_FIELD2(  2, UINT32  , OPTIONAL, STATIC, OTHER, openxc_RawMessage, message_id, bus, 0),
    PB_FIELD2(  3, SINT64  , OPTIONAL, STATIC, OTHER, openxc_RawMessage, data, message_id, 0),
    PB_LAST_FIELD
};

const pb_field_t openxc_TranslatedStringMessage_fields[3] = {
    PB_FIELD2(  1, STRING  , OPTIONAL, STATIC, FIRST, openxc_TranslatedStringMessage, name, name, 0),
    PB_FIELD2(  2, STRING  , OPTIONAL, STATIC, OTHER, openxc_TranslatedStringMessage, value, name, 0),
    PB_LAST_FIELD
};

const pb_field_t openxc_TranslatedNumericMessage_fields[3] = {
    PB_FIELD2(  1, STRING  , OPTIONAL, STATIC, FIRST, openxc_TranslatedNumericMessage, name, name, 0),
/* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.2.4 at Wed Jan 01 01:23:54 2014. */

#include "messages.pb.h"

const uint32_t DeleteWallet_wallet_handle_default = 0;
const uint32_t NewWallet_wallet_number_default = 0;
const bool NewWallet_is_hidden_default = false;
const uint32_t LoadWallet_wallet_number_default = 0;
const bool BackupWallet_is_encrypted_default = false;
const uint32_t BackupWallet_device_default = 0;


const pb_field_t Initialize_fields[2] = {
    PB_FIELD2(  1, BYTES   , REQUIRED, STATIC, FIRST, Initialize, session_id, session_id, 0),
    PB_LAST_FIELD
};

const pb_field_t Features_fields[11] = {
    PB_FIELD2(  1, BYTES   , REQUIRED, STATIC, FIRST, Features, echoed_session_id, echoed_session_id, 0),
    PB_FIELD2(  2, STRING  , OPTIONAL, CALLBACK, OTHER, Features, vendor, echoed_session_id, 0),
    PB_FIELD2(  3, UINT32  , OPTIONAL, STATIC, OTHER, Features, major_version, vendor, 0),
    PB_FIELD2(  4, UINT32  , OPTIONAL, STATIC, OTHER, Features, minor_version, major_version, 0),
    PB_FIELD2(  5, STRING  , OPTIONAL, CALLBACK, OTHER, Features, config, minor_version, 0),
    PB_FIELD2(  6, BOOL    , OPTIONAL, STATIC, OTHER, Features, otp, config, 0),
    PB_FIELD2(  7, BOOL    , OPTIONAL, STATIC, OTHER, Features, pin, otp, 0),
    PB_FIELD2(  8, BOOL    , OPTIONAL, STATIC, OTHER, Features, spv, pin, 0),
    PB_FIELD2(  9, ENUM    , REPEATED, STATIC, OTHER, Features, algo, spv, 0),
    PB_FIELD2( 10, BOOL    , OPTIONAL, STATIC, OTHER, Features, debug_link, algo, 0),
    PB_LAST_FIELD
};
Ejemplo n.º 8
0
/* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.2.6 at Mon Mar 24 22:54:50 2014. */

#include "movement.pb.h"



const pb_field_t Movement_fields[4] = {
    PB_FIELD2(  1, SINT32  , REQUIRED, STATIC  , FIRST, Movement, power, power, 0),
    PB_FIELD2(  2, SINT32  , REQUIRED, STATIC  , OTHER, Movement, direction, power, 0),
    PB_FIELD2(  3, INT32   , REQUIRED, STATIC  , OTHER, Movement, duration, direction, 0),
    PB_LAST_FIELD
};


Ejemplo n.º 9
0
/* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.2.3 at Thu Nov  7 17:41:49 2013. */

#include "GCSData.pb.h"



const pb_field_t EulerAngles_t_fields[4] = {
    PB_FIELD2(  1, DOUBLE  , OPTIONAL, STATIC, FIRST, EulerAngles_t, roll, roll, 0),
    PB_FIELD2(  2, DOUBLE  , OPTIONAL, STATIC, OTHER, EulerAngles_t, pitch, roll, 0),
    PB_FIELD2(  3, DOUBLE  , OPTIONAL, STATIC, OTHER, EulerAngles_t, yaw, pitch, 0),
    PB_LAST_FIELD
};

const pb_field_t Axes_t_fields[4] = {
    PB_FIELD2(  4, DOUBLE  , OPTIONAL, STATIC, FIRST, Axes_t, x, x, 0),
    PB_FIELD2(  5, DOUBLE  , OPTIONAL, STATIC, OTHER, Axes_t, y, x, 0),
    PB_FIELD2(  6, DOUBLE  , OPTIONAL, STATIC, OTHER, Axes_t, z, y, 0),
    PB_LAST_FIELD
};

const pb_field_t GPS_t_fields[5] = {
    PB_FIELD2(  8, INT32   , OPTIONAL, STATIC, FIRST, GPS_t, localization, localization, 0),
    PB_FIELD2(  9, INT32   , OPTIONAL, STATIC, OTHER, GPS_t, direction, localization, 0),
    PB_FIELD2( 10, INT32   , OPTIONAL, STATIC, OTHER, GPS_t, speed, direction, 0),
    PB_FIELD2( 11, INT32   , OPTIONAL, STATIC, OTHER, GPS_t, height, speed, 0),
    PB_LAST_FIELD
};

const pb_field_t Control_t_fields[5] = {
    PB_FIELD2( 12, ENUM    , OPTIONAL, STATIC, FIRST, Control_t, go_direction, go_direction, 0),