Dawn Framework 1.0
Universal data acquisition framework for embedded systems
lte.hxx
1// dawn/include/dawn/system/lte.hxx
2//
3// SPDX-License-Identifier: Apache-2.0
4//
5
6#pragma once
7
8#include "dawn/system/common.hxx"
9#include "dawn/porting/lte.hxx"
10
11namespace dawn
12{
22{
23public:
26 enum
27 {
28 LTE_CFG_FIRST = 0,
35 LTE_CFG_LAST = 31
36 };
37
40 enum
41 {
42 LTE_APN_SIZE = 64,
43 LTE_USER_SIZE = 32,
44 LTE_PASS_SIZE = 32
45 };
46
49 constexpr static SObjectId::ObjectId objectId(uint16_t inst = 0)
50 {
53 }
54
57 constexpr static SObjectCfg::ObjectCfgId cfgIdApn(uint16_t words, bool rw = true)
58 {
60 }
61
62 constexpr static SObjectCfg::ObjectCfgId cfgIdUsername(uint16_t words, bool rw = true)
63 {
65 }
66
67 constexpr static SObjectCfg::ObjectCfgId cfgIdPassword(uint16_t words, bool rw = true)
68 {
70 }
71
72 constexpr static SObjectCfg::ObjectCfgId cfgIdAuthType(bool rw = true)
73 {
75 }
76
77 constexpr static SObjectCfg::ObjectCfgId cfgIdIpType(bool rw = true)
78 {
80 }
81
82 constexpr static SObjectCfg::ObjectCfgId cfgIdRegTimeout(bool rw = true)
83 {
85 }
86
87 explicit CSystemLte(CDescObject &desc);
88
89 int configure() override;
90
91#ifdef CONFIG_DAWN_OBJECT_HAS_NAME
92 const char *getClassNameStr() const override
93 {
94 return "lte";
95 }
96#endif
97
98protected:
99 int doStart() override;
100 int doStop() override;
101
102private:
103 char apn[LTE_APN_SIZE];
104 char username[LTE_USER_SIZE];
105 char password[LTE_PASS_SIZE];
106 uint8_t auth_type;
107 uint8_t ip_type;
108 uint8_t psave_mode;
109 uint32_t reg_timeout;
110
113 void loadParams();
114};
115} // Namespace dawn
Base class for OBJTYPE_ANY configuration objects.
Definition common.hxx:25
@ SYSTEM_CLASS_LTE
LTE / cellular connectivity settings.
Definition common.hxx:30
static SObjectCfg::ObjectCfgId cfgId(uint16_t cls, uint8_t dtype, bool rw, uint16_t size, uint8_t id)
Build a config-item id for a dev object.
Definition common.hxx:52
LTE connectivity object (OBJTYPE_ANY, cls = SYSTEM_CLASS_LTE).
Definition lte.hxx:22
static SObjectId::ObjectId objectId(uint16_t inst=0)
Build this object's ObjectId for a given instance.
Definition lte.hxx:49
static SObjectCfg::ObjectCfgId cfgIdApn(uint16_t words, bool rw=true)
Config-item id helpers (cls = SYSTEM_CLASS_LTE).
Definition lte.hxx:57
int configure()
Configure object from descriptor data.
Definition lte.cxx:106
@ LTE_CFG_AUTHTYPE
DAWN_LTE_AUTH_* (DTYPE_UINT8)
Definition lte.hxx:32
@ LTE_CFG_USERNAME
APN username (DTYPE_CHAR)
Definition lte.hxx:30
@ LTE_CFG_IPTYPE
DAWN_LTE_IPTYPE_* (DTYPE_UINT8)
Definition lte.hxx:33
@ LTE_CFG_REG_TIMEOUT
Registration timeout, seconds (DTYPE_UINT32)
Definition lte.hxx:34
@ LTE_CFG_PASSWORD
APN password (DTYPE_CHAR)
Definition lte.hxx:31
@ LTE_CFG_APN
APN (DTYPE_CHAR)
Definition lte.hxx:29
int doStart()
Start implementation hook.
Definition lte.cxx:119
int doStop()
Stop implementation hook.
Definition lte.cxx:145
uint32_t ObjectCfgId
ConfigID type - single 32-bit value.
Definition objectcfg.hxx:60
Out-of-tree user-extension hooks for Dawn.
Definition bindable.hxx:13
@ OBJTYPE_ANY
Wildcard/metadata object type.
Definition objectid.hxx:176
@ DTYPE_UINT8
Unsigned 8-bit integer (0 to 255).
Definition objectid.hxx:80
@ DTYPE_ANY
Wildcard data type (matches any actual type).
Definition objectid.hxx:68
@ DTYPE_CHAR
Character/string type (null-terminated, 4-byte aligned).
Definition objectid.hxx:144
@ DTYPE_UINT32
Unsigned 32-bit integer (0 to 4294967295).
Definition objectid.hxx:96
uint32_t ObjectId
ObjectID type - single 32-bit value.
Definition objectid.hxx:44
static ObjectId objectId(uint8_t type, uint16_t cls, uint8_t dtype, uint8_t flags, uint16_t priv)
Construct 32-bit ObjectID from component fields.
Definition objectid.hxx:290