|
ESP SDK C API
|
Constant Definitions | |
| #define | ESP_DATATYPE_INTEGER |
| #define | ESP_DATATYPE_LONG |
| #define | ESP_DATATYPE_FLOAT |
| #define | ESP_DATATYPE_DATE |
| #define | ESP_DATATYPE_STRING |
| #define | ESP_DATATYPE_NULL |
| #define | ESP_DATATYPE_MONEY |
| #define | ESP_DATATYPE_TIMESTAMP |
| #define | ESP_DATATYPE_OBJECT |
| #define | ESP_DATATYPE_BOOLEAN |
| #define | ESP_DATATYPE_MONEY01 |
| #define | ESP_DATATYPE_MONEY02 |
| #define | ESP_DATATYPE_MONEY03 |
| #define | ESP_DATATYPE_MONEY04 |
| #define | ESP_DATATYPE_MONEY05 |
| #define | ESP_DATATYPE_MONEY06 |
| #define | ESP_DATATYPE_MONEY07 |
| #define | ESP_DATATYPE_MONEY08 |
| #define | ESP_DATATYPE_MONEY09 |
| #define | ESP_DATATYPE_MONEY10 |
| #define | ESP_DATATYPE_MONEY11 |
| #define | ESP_DATATYPE_MONEY12 |
| #define | ESP_DATATYPE_MONEY13 |
| #define | ESP_DATATYPE_MONEY14 |
| #define | ESP_DATATYPE_MONEY15 |
| #define | ESP_DATATYPE_INTERVAL |
| #define | ESP_DATATYPE_BIGDATETIME |
| #define | ESP_DATATYPE_BINARY |
| #define ESP_DATATYPE_BIGDATETIME |
64 bit signed # of *micro*seconds since unix epoch.
| #define ESP_DATATYPE_BINARY |
raw buffer containing binary data
| #define ESP_DATATYPE_BOOLEAN |
boolean
| #define ESP_DATATYPE_DATE |
unsigned integer representing seconds since the epoch (time_t)
| #define ESP_DATATYPE_FLOAT |
64-bit floating point
| #define ESP_DATATYPE_INTEGER |
32-bit integer
| #define ESP_DATATYPE_INTERVAL |
64-bit integer representing interval value in microseconds
| #define ESP_DATATYPE_LONG |
64-bit integer
| #define ESP_DATATYPE_MONEY |
legacy money type whose precision depends on the setting in the project connect to
| #define ESP_DATATYPE_MONEY01 |
Money type with precision 1 (range -922,337,203,685,477,580.8 through +922,337,203,685,477,580.7)
| #define ESP_DATATYPE_MONEY02 |
Money type with precision 2 (range -92,233,720,368,547,758.08 through +92,233,720,368,547,758.07)
| #define ESP_DATATYPE_MONEY03 |
Money type with precision 3 (range -9,223,372,036,854,775.808 through +9,223,372,036,854,775.807)
| #define ESP_DATATYPE_MONEY04 |
Money type with precision 4 (range -922,337,203,685,477.5808 through +922,337,203,685,477.5807 )
| #define ESP_DATATYPE_MONEY05 |
Money type with precision 5 (range -92,233,720,368,547.75808 through +92,233,720,368,547.75807 )
| #define ESP_DATATYPE_MONEY06 |
Money type with precision 6 (range -9,223,372,036,854.775808 through +9,223,372,036,854.775807 )
| #define ESP_DATATYPE_MONEY07 |
Money type with precision 7 (range -922,337,203,685.4775808 through +922,337,203,685.4775807 )
| #define ESP_DATATYPE_MONEY08 |
Money type with precision 8 (range -92,233,720,368.54775808 through +92,233,720,368.54775807 )
| #define ESP_DATATYPE_MONEY09 |
Money type with precision 9 (range -9,223,372,036.854775808 through +9,223,372,036.854775807 )
| #define ESP_DATATYPE_MONEY10 |
Money type with precision 10 (range -922,337,203.6854775808 through +922,337,203.6854775807 )
| #define ESP_DATATYPE_MONEY11 |
Money type with precision 11 (range -92,233,720.36854775808 through +92,233,720.36854775807 )
| #define ESP_DATATYPE_MONEY12 |
Money type with precision 12 (range -9,223,372.036854775808 through +9,223,372.036854775807 )
| #define ESP_DATATYPE_MONEY13 |
Money type with precision 13 (range -9,223.372036854775808 through +9,223.372036854775807 )
| #define ESP_DATATYPE_MONEY14 |
Money type with precision 14 (range -9,223.372036854775808 through +9,223.372036854775807 )
| #define ESP_DATATYPE_MONEY15 |
Money type with precision 15 (range -9,223.372036854775808 through +9,223.372036854775807 )
| #define ESP_DATATYPE_NULL |
generic type for null values. Not used. Use is_null() to check
| #define ESP_DATATYPE_OBJECT |
Not used
| #define ESP_DATATYPE_STRING |
variable length string
| #define ESP_DATATYPE_TIMESTAMP |
64 bit signed # of milliseconds since unix epoch.
Functions | |
| ESPAPICALL int32_t | esp_data_binary_from_hexstring (const char *hexstring, uint8_t *binary_data, uint32_t *buffsize, EspError *error) |
| ESPAPICALL int32_t | esp_data_hexstring_from_binary (const uint8_t *binary_data, const uint32_t data_size, char *hexstring, uint32_t *buffsize, EspError *error) |
| ESPAPICALL EspMoney * | esp_money_create (EspError *error) |
| ESPAPICALL EspMoney * | esp_money_create_string (const char *string_value, EspError *error) |
| ESPAPICALL EspMoney * | esp_money_create_long (const int64_t long_value, const uint32_t precision, EspError *error) |
| ESPAPICALL EspMoney * | esp_money_as_precision (const EspMoney *money, const uint32_t precision, EspError *error) |
| ESPAPICALL int32_t | esp_money_free (EspMoney *money, EspError *error) |
| ESPAPICALL int32_t | esp_money_get_long (const EspMoney *money, int64_t *long_value, EspError *error) |
| ESPAPICALL int32_t | esp_money_get_precision (const EspMoney *money, uint32_t *precision, EspError *error) |
| ESPAPICALL int32_t | esp_money_get_factor (const EspMoney *money, uint64_t *factor, EspError *error) |
| ESPAPICALL EspBigDatetime * | esp_bigdatetime_create (EspError *error) |
| ESPAPICALL EspBigDatetime * | esp_bigdatetime_create_string (const char *string_value, EspError *error) |
| ESPAPICALL EspBigDatetime * | esp_bigdatetime_create_microseconds (const int64_t microseconds, EspError *error) |
| ESPAPICALL int32_t | esp_bigdatetime_free (EspBigDatetime *datetime, EspError *error) |
| ESPAPICALL int32_t | esp_bigdatetime_get_microseconds (const EspBigDatetime *datetime, int64_t *microseconds, EspError *error) |
| ESPAPICALL EspBigDatetime* esp_bigdatetime_create | ( | EspError * | error | ) |
Create an uninitialized EspBigDatetime object.
| ESPAPICALL EspBigDatetime* esp_bigdatetime_create_microseconds | ( | const int64_t | microseconds, |
| EspError * | error | ||
| ) |
Create an uninitialized EspBigDatetime object.
| ESPAPICALL EspBigDatetime* esp_bigdatetime_create_string | ( | const char * | string_value, |
| EspError * | error | ||
| ) |
Create an EspBigDatetime object initialized from the supplied string.
| ESPAPICALL int32_t esp_bigdatetime_free | ( | EspBigDatetime * | datetime, |
| EspError * | error | ||
| ) |
| ESPAPICALL int32_t esp_bigdatetime_get_microseconds | ( | const EspBigDatetime * | datetime, |
| int64_t * | microseconds, | ||
| EspError * | error | ||
| ) |
| ESPAPICALL int32_t esp_data_binary_from_hexstring | ( | const char * | hexstring, |
| uint8_t * | binary_data, | ||
| uint32_t * | buffsize, | ||
| EspError * | error | ||
| ) |
Converts the passed hexstring to its corresponding binary representation. The size of the binary data buffer must be passed in the parameter buffsize. If the buffer is large enough, converted binary data is copied to the supplied buffer. If not, an error is returned. In both cases, buffsize will contain the size of the binary data.
| hexstring | hexstring to convert |
| binary_data | buffer to hold binary data |
| buffsize | on input size of buffer, on output size of binary data |
| ESPAPICALL int32_t esp_data_hexstring_from_binary | ( | const uint8_t * | binary_data, |
| const uint32_t | data_size, | ||
| char * | hexstring, | ||
| uint32_t * | buffsize, | ||
| EspError * | error | ||
| ) |
Converts passed binary data to its corresponding hex string representation. The size of the string buffer must be passed in the parameter buffsize. If the buffer is large enough, the hex string is copied to the supplied buffer. If not, an error is returned. In both cases, buffsize will contain the length of the hex string.
| binary_data | binary data to convert |
| data_size | length of the binary data |
| hexstring | buffer to hold converted hex string |
| buffsize | on input size of hex string buffer, on output size of the hex string |
| ESPAPICALL EspMoney* esp_money_as_precision | ( | const EspMoney * | money, |
| const uint32_t | precision, | ||
| EspError * | error | ||
| ) |
Creates a new EspMoney object with the specified precision. The returned EspMoney must be released using esp_money_free(). Returns an error if the conversion would result in a loss of precision or range.
| money | EspMoney to convert |
| precision | precision to which to convert |
| ESPAPICALL EspMoney* esp_money_create | ( | EspError * | error | ) |
Creates an uninitialized EspMoney object. The object must be freed using esp_money_free().
| ESPAPICALL EspMoney* esp_money_create_long | ( | const int64_t | long_value, |
| const uint32_t | precision, | ||
| EspError * | error | ||
| ) |
Creates an EspMoney object from the supplied 64-bit integer value and the specified precision. For example, a value of 72634947 and a precision of 4 will result in an EspMoney object with the effective value 7263.4947.
| long_value | Integral value for the money to create |
| precision | Precision to use |
| ESPAPICALL EspMoney* esp_money_create_string | ( | const char * | string_value, |
| EspError * | error | ||
| ) |
Creates an EspMoney object from the supplied string value. The function expects to find a decimal point in the string to determine the precision. If it does not find one, it will generate an error.
| string_value | string value with a decimal point |
| ESPAPICALL int32_t esp_money_free | ( | EspMoney * | money, |
| EspError * | error | ||
| ) |
Free an EspMoney object created with esp_money_create_long() or esp_money_create_string().
| money | EspMoney object to free |
| ESPAPICALL int32_t esp_money_get_factor | ( | const EspMoney * | money, |
| uint64_t * | factor, | ||
| EspError * | error | ||
| ) |
Retrieve the effective factor in this EspMoney object.
| money | EspMoney object to query |
| factor | Pointer in which to return the factor |
| ESPAPICALL int32_t esp_money_get_long | ( | const EspMoney * | money, |
| int64_t * | long_value, | ||
| EspError * | error | ||
| ) |
Retrieve the effective integral value in this EspMoney object.
| money | EspMoney object to query |
| long_value | Pointer in which to return the integral value |
| ESPAPICALL int32_t esp_money_get_precision | ( | const EspMoney * | money, |
| uint32_t * | precision, | ||
| EspError * | error | ||
| ) |
Retrieve the precision of this EspMoney object.
| money | EspMoney object to query |
| precision | Pointer in which to return the precision |
1.7.5