7 #ifndef _GREENGRASS_SDK_H_
8 #define _GREENGRASS_SDK_H_
16 #include <sys/types.h>
42 GGE_RESERVED_PAD = 0x7FFFFFFF
45 typedef struct _gg_request *gg_request;
65 GG_REQUEST_RESERVED_MAX,
66 GG_REQUEST_RESERVED_PAD = 0x7FFFFFFF
84 const char *function_arn;
85 const char *client_context;
97 GG_INVOKE_RESERVED_MAX,
98 GG_INVOKE_RESERVED_PAD = 0x7FFFFFFF
107 GG_RT_OPT_RESERVED_PAD = 0x7FFFFFFF
121 const char *function_arn;
122 const char *customer_context;
123 const char *qualifier;
140 GG_QUEUE_FULL_POLICY_RESERVED_MAX,
141 GG_QUEUE_FULL_POLICY_RESERVED_PAD = 0x7FFFFFFF
144 typedef struct _gg_publish_options *gg_publish_options;
150 GG_LOG_RESERVED_NOTSET,
164 GG_LOG_RESERVED_PAD = 0x7FFFFFFF
227 size_t *amount_read);
260 size_t *amount_read);
270 size_t response_size);
296 const char *version_id,
const char *version_stage,
352 const void *payload,
size_t payload_size,
const gg_publish_options opts,
387 const char *update_payload,
gg_error gg_log(gg_log_level level, const char *format,...)
Log message to Greengrass Core using similar syntax to printf.
gg_error gg_lambda_handler_write_error(const char *error_message)
Write error message to the invoker of the lambda.
Definition: greengrasssdk.h:93
Definition: greengrasssdk.h:153
Definition: greengrasssdk.h:33
gg_error gg_lambda_handler_read(void *buffer, size_t buffer_size, size_t *amount_read)
Read the data from the invoker of the lambda. This method should be called till amount_read is zero...
Describes the options to invoke a target lambda.
Definition: greengrasssdk.h:120
gg_error gg_lambda_handler_write_response(const void *response, size_t response_size)
Write response to the invoker of the lambda.
gg_runtime_opt
Flags set for the gg_runtime_start)(.., opt)
Definition: greengrasssdk.h:104
gg_error gg_update_thing_shadow(gg_request ggreq, const char *thing_name, const char *update_payload, gg_request_result *result)
Update thing shadow for thing name.
void(* gg_lambda_handler)(const gg_lambda_context *cxt)
Handler signature that will be called whenever a subscribed message is received.
Definition: greengrasssdk.h:238
gg_error gg_request_close(gg_request ggreq)
Close a request context that was created by gg_request_init.
gg_error gg_invoke(gg_request ggreq, const gg_invoke_options *opts, gg_request_result *result)
Invoke a lambda with an optional payload.
gg_error gg_publish(gg_request ggreq, const char *topic, const void *payload, size_t payload_size, gg_request_result *result)
Publish a payload to a topic.
Definition: greengrasssdk.h:95
Definition: greengrasssdk.h:39
gg_error gg_publish_options_free(gg_publish_options opts)
Free a publish options that was created by gg_publish_options_init.
struct gg_request_result gg_request_result
Describes result metadata after request is made.
Definition: greengrasssdk.h:37
gg_error gg_get_secret_value(gg_request ggreq, const char *secret_id, const char *version_id, const char *version_stage, gg_request_result *result)
Get secret value for the given secret.
Definition: greengrasssdk.h:55
Definition: greengrasssdk.h:159
Definition: greengrasssdk.h:29
gg_queue_full_policy_options
Describes the policy options to take when Greengrass's queue is full.
Definition: greengrasssdk.h:132
gg_error gg_global_init(uint32_t opt)
Initialize Greengrass internal global variables.
Definition: greengrasssdk.h:57
Definition: greengrasssdk.h:31
Describes context when lambda handler is called.
Definition: greengrasssdk.h:83
Definition: greengrasssdk.h:61
gg_error gg_publish_options_init(gg_publish_options *opts)
Initialize the publish options.
gg_error gg_get_thing_shadow(gg_request ggreq, const char *thing_name, gg_request_result *result)
Get thing shadow for thing name.
Definition: greengrasssdk.h:157
Definition: greengrasssdk.h:59
gg_invoke_type
Describes invocation type for lambda function.
Definition: greengrasssdk.h:91
gg_error gg_publish_options_set_queue_full_policy(gg_publish_options opts, gg_queue_full_policy_options policy)
Sets the queue full policy on a publish options.
Definition: greengrasssdk.h:106
Definition: greengrasssdk.h:161
gg_error gg_runtime_start(gg_lambda_handler handler, uint32_t opt)
Registers the lambda handler and start Greengrass lambda runtime.
gg_error gg_publish_with_options(gg_request ggreq, const char *topic, const void *payload, size_t payload_size, const gg_publish_options opts, gg_request_result *result)
Publish a payload to a topic.
gg_error gg_request_init(gg_request *ggreq)
Initialize the context for managing the request.
gg_error
Greengrass SDK error enum.
Definition: greengrasssdk.h:27
gg_error gg_delete_thing_shadow(gg_request ggreq, const char *thing_name, gg_request_result *result)
Delete thing shadow for thing name.
Definition: greengrasssdk.h:134
Definition: greengrasssdk.h:35
Definition: greengrasssdk.h:155
gg_request_status
Greengrass SDK request status enum.
Definition: greengrasssdk.h:53
Definition: greengrasssdk.h:63
struct gg_invoke_options gg_invoke_options
Describes the options to invoke a target lambda.
Describes result metadata after request is made.
Definition: greengrasssdk.h:73
gg_log_level
Describes log levels could used in gg_log()
Definition: greengrasssdk.h:149
struct gg_lambda_context gg_lambda_context
Describes context when lambda handler is called.
gg_error gg_request_read(gg_request ggreq, void *buffer, size_t buffer_size, size_t *amount_read)
Read the data from a request. This method should be called till amount_read is zero.
gg_request_status request_status
Definition: greengrasssdk.h:75
Definition: greengrasssdk.h:138