Golioth Firmware SDK
Loading...
Searching...
No Matches
location.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2024 Golioth, Inc.
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifdef __cplusplus
8
extern
"C"
9
{
10
#endif
11
12
#pragma once
13
14
#include <
golioth/client.h
>
15
#include <
golioth/golioth_status.h
>
16
#include <stdint.h>
17
#include <zcbor_encode.h>
18
19
struct
golioth_location_rsp
20
{
22
int64_t
latitude
;
24
int64_t
longitude
;
25
27
int64_t
accuracy
;
28
};
29
30
#define GOLIOTH_LOCATION_FLAG_WIFI (1 << 0)
31
36
struct
golioth_location_req
37
{
38
uint8_t
buf
[
CONFIG_GOLIOTH_LOCATION_REQUEST_BUFFER_SIZE
];
39
zcbor_state_t
zse
[2
/* backup */
+ 1
/* WiFi only */
];
40
int
flags
;
41
};
42
48
void
golioth_location_init
(
struct
golioth_location_req
*req);
49
61
enum
golioth_status
golioth_location_finish
(
struct
golioth_location_req
*req);
62
75
enum
golioth_status
golioth_location_get_sync
(
struct
golioth_client *client,
76
const
struct
golioth_location_req
*req,
77
struct
golioth_location_rsp
*rsp,
78
int32_t timeout_s);
79
80
#ifdef __cplusplus
81
}
82
#endif
client.h
CONFIG_GOLIOTH_LOCATION_REQUEST_BUFFER_SIZE
#define CONFIG_GOLIOTH_LOCATION_REQUEST_BUFFER_SIZE
Definition
config.h:125
golioth_status.h
golioth_status
golioth_status
Definition
golioth_status.h:37
golioth_location_finish
enum golioth_status golioth_location_finish(struct golioth_location_req *req)
golioth_location_init
void golioth_location_init(struct golioth_location_req *req)
golioth_location_get_sync
enum golioth_status golioth_location_get_sync(struct golioth_client *client, const struct golioth_location_req *req, struct golioth_location_rsp *rsp, int32_t timeout_s)
golioth_location_req
Wi-Fi location request, used with golioth_location_init(), golioth_location_finish() and golioth_loca...
Definition
location.h:37
golioth_location_req::zse
zcbor_state_t zse[2+1]
Definition
location.h:39
golioth_location_req::flags
int flags
Definition
location.h:40
golioth_location_req::buf
uint8_t buf[CONFIG_GOLIOTH_LOCATION_REQUEST_BUFFER_SIZE]
Definition
location.h:38
golioth_location_rsp
Definition
location.h:20
golioth_location_rsp::latitude
int64_t latitude
Definition
location.h:22
golioth_location_rsp::accuracy
int64_t accuracy
Definition
location.h:27
golioth_location_rsp::longitude
int64_t longitude
Definition
location.h:24
include
golioth
location.h
Generated on Thu Jan 16 2025 18:46:27 for Golioth Firmware SDK by
1.10.0