/* Automatically generated nanopb header */ /* Generated by nanopb-0.4.9.1 */ #ifndef PB_MESHTASTIC_MESHTASTIC_SERIAL_HAL_PB_H_INCLUDED #define PB_MESHTASTIC_MESHTASTIC_SERIAL_HAL_PB_H_INCLUDED #include #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif /* Enum definitions */ typedef enum _meshtastic_SerialHalCommand_Type { meshtastic_SerialHalCommand_Type_UNSET = 0, meshtastic_SerialHalCommand_Type_PIN_MODE = 1, meshtastic_SerialHalCommand_Type_DIGITAL_WRITE = 2, meshtastic_SerialHalCommand_Type_DIGITAL_READ = 3, meshtastic_SerialHalCommand_Type_ATTACH_INTERRUPT = 4, meshtastic_SerialHalCommand_Type_DETACH_INTERRUPT = 5, meshtastic_SerialHalCommand_Type_SPI_TRANSFER = 6, meshtastic_SerialHalCommand_Type_NOOP = 7 } meshtastic_SerialHalCommand_Type; typedef enum _meshtastic_SerialHalResponse_Result { meshtastic_SerialHalResponse_Result_OK = 0, meshtastic_SerialHalResponse_Result_ERROR = 1, meshtastic_SerialHalResponse_Result_BAD_REQUEST = 2, meshtastic_SerialHalResponse_Result_UNSUPPORTED = 3 } meshtastic_SerialHalResponse_Result; /* Struct definitions */ typedef PB_BYTES_ARRAY_T(512) meshtastic_SerialHalCommand_data_t; typedef struct _meshtastic_SerialHalCommand { /* Host-assigned request id. Replies echo this id back in SerialHalResponse.transaction_id. */ uint32_t transaction_id; meshtastic_SerialHalCommand_Type type; uint32_t pin; uint32_t value; uint32_t mode; meshtastic_SerialHalCommand_data_t data; } meshtastic_SerialHalCommand; typedef PB_BYTES_ARRAY_T(512) meshtastic_SerialHalResponse_data_t; typedef struct _meshtastic_SerialHalResponse { /* Matches the originating SerialHalCommand.transaction_id for normal request/response traffic. A value of 0 indicates an unsolicited interrupt notification generated by the device. In that case, the host should interpret value as the GPIO pin that triggered. */ uint32_t transaction_id; meshtastic_SerialHalResponse_Result result; /* Used by DIGITAL_READ replies and interrupt notifications. For interrupt notifications (transaction_id == 0), this carries the pin number. */ uint32_t value; meshtastic_SerialHalResponse_data_t data; char error[80]; } meshtastic_SerialHalResponse; #ifdef __cplusplus extern "C" { #endif /* Helper constants for enums */ #define _meshtastic_SerialHalCommand_Type_MIN meshtastic_SerialHalCommand_Type_UNSET #define _meshtastic_SerialHalCommand_Type_MAX meshtastic_SerialHalCommand_Type_NOOP #define _meshtastic_SerialHalCommand_Type_ARRAYSIZE ((meshtastic_SerialHalCommand_Type)(meshtastic_SerialHalCommand_Type_NOOP+1)) #define _meshtastic_SerialHalResponse_Result_MIN meshtastic_SerialHalResponse_Result_OK #define _meshtastic_SerialHalResponse_Result_MAX meshtastic_SerialHalResponse_Result_UNSUPPORTED #define _meshtastic_SerialHalResponse_Result_ARRAYSIZE ((meshtastic_SerialHalResponse_Result)(meshtastic_SerialHalResponse_Result_UNSUPPORTED+1)) #define meshtastic_SerialHalCommand_type_ENUMTYPE meshtastic_SerialHalCommand_Type #define meshtastic_SerialHalResponse_result_ENUMTYPE meshtastic_SerialHalResponse_Result /* Initializer values for message structs */ #define meshtastic_SerialHalCommand_init_default {0, _meshtastic_SerialHalCommand_Type_MIN, 0, 0, 0, {0, {0}}} #define meshtastic_SerialHalResponse_init_default {0, _meshtastic_SerialHalResponse_Result_MIN, 0, {0, {0}}, ""} #define meshtastic_SerialHalCommand_init_zero {0, _meshtastic_SerialHalCommand_Type_MIN, 0, 0, 0, {0, {0}}} #define meshtastic_SerialHalResponse_init_zero {0, _meshtastic_SerialHalResponse_Result_MIN, 0, {0, {0}}, ""} /* Field tags (for use in manual encoding/decoding) */ #define meshtastic_SerialHalCommand_transaction_id_tag 1 #define meshtastic_SerialHalCommand_type_tag 2 #define meshtastic_SerialHalCommand_pin_tag 3 #define meshtastic_SerialHalCommand_value_tag 4 #define meshtastic_SerialHalCommand_mode_tag 5 #define meshtastic_SerialHalCommand_data_tag 6 #define meshtastic_SerialHalResponse_transaction_id_tag 1 #define meshtastic_SerialHalResponse_result_tag 2 #define meshtastic_SerialHalResponse_value_tag 3 #define meshtastic_SerialHalResponse_data_tag 4 #define meshtastic_SerialHalResponse_error_tag 5 /* Struct field encoding specification for nanopb */ #define meshtastic_SerialHalCommand_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, transaction_id, 1) \ X(a, STATIC, SINGULAR, UENUM, type, 2) \ X(a, STATIC, SINGULAR, UINT32, pin, 3) \ X(a, STATIC, SINGULAR, UINT32, value, 4) \ X(a, STATIC, SINGULAR, UINT32, mode, 5) \ X(a, STATIC, SINGULAR, BYTES, data, 6) #define meshtastic_SerialHalCommand_CALLBACK NULL #define meshtastic_SerialHalCommand_DEFAULT NULL #define meshtastic_SerialHalResponse_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, transaction_id, 1) \ X(a, STATIC, SINGULAR, UENUM, result, 2) \ X(a, STATIC, SINGULAR, UINT32, value, 3) \ X(a, STATIC, SINGULAR, BYTES, data, 4) \ X(a, STATIC, SINGULAR, STRING, error, 5) #define meshtastic_SerialHalResponse_CALLBACK NULL #define meshtastic_SerialHalResponse_DEFAULT NULL extern const pb_msgdesc_t meshtastic_SerialHalCommand_msg; extern const pb_msgdesc_t meshtastic_SerialHalResponse_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ #define meshtastic_SerialHalCommand_fields &meshtastic_SerialHalCommand_msg #define meshtastic_SerialHalResponse_fields &meshtastic_SerialHalResponse_msg /* Maximum encoded size of messages (where known) */ #define MESHTASTIC_MESHTASTIC_SERIAL_HAL_PB_H_MAX_SIZE meshtastic_SerialHalResponse_size #define meshtastic_SerialHalCommand_size 541 #define meshtastic_SerialHalResponse_size 610 #ifdef __cplusplus } /* extern "C" */ #endif #endif