RDK Documentation (Open Sourced RDK Components)
btrMgr_LEOnboarding.h
Go to the documentation of this file.
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 /**
20  * @file btrMgr_LeOnboarding.h
21  *
22  * @defgroup Sys_DiagInfo LeOnboardingInfoInterface
23  * This file defines
24  * @ingroup BTR_MGR
25  *
26  */
27 
28 #ifndef __BTR_MGR_LEONBOARDING_H__
29 #define __BTR_MGR_LEONBOARDING_H__
30 
31 #define BTRMGR_LE_STR_LEN_MAX (256*3)
32 #define MAX_LEN_PUBLIC_KEY BTRMGR_LE_STR_LEN_MAX
33 #define MAX_PAYLOAD_LEN 2048
34 #define SSID_MAX_LEN 32
35 #define PASS_PHRASE_LEN 64
36 #define MAX_FREQ_STR_LEN 7 //2.4GHz or 5GHz
37 
38 typedef enum _BTRMGR_LeOnboardingChar_t {
39  BTRMGR_LE_ONBRDG_BEGIN = 300,
40  BTRMGR_LE_ONBRDG_SYSTEMID,
41  BTRMGR_LE_ONBRDG_MODELNUMBER,
42  BTRMGR_LE_ONBRDG_SERIALNUMBER,
43  BTRMGR_LE_ONBRDG_FWREVISION,
44  BTRMGR_LE_ONBRDG_HWREVISION,
45  BTRMGR_LE_ONBRDG_SWREVISION,
46  BTRMGR_LE_ONBRDG_MFGRNAME,
47  BTRMGR_LE_ONBRDG_UUID_QR_CODE,
48  BTRMGR_LE_ONBRDG_UUID_PROVISION_STATUS,
49  BTRMGR_LE_ONBRDG_UUID_PUBLIC_KEY,
50  BTRMGR_LE_ONBRDG_UUID_WIFI_CONFIG,
51  BTRMGR_LE_ONBRDG_UUID_SSID_LIST,
52  BTRMGR_LE_ONBRDG_UNKNOWN,
53  BTRMGR_LE_ONBRDG_END
54 } BTRMGR_LeOnboardingChar_t;
55 
56 typedef enum _BTRMGR_LeOnbrdg_WifiPrvsnStatus_t {
57  BTRMGR_LE_ONBRDG_AWAITING_WIFI_CONFIG = 0x0101, /* RDK device is waiting for WiFi configuration from Mobile Application */
58  BTRMGR_LE_ONBRDG_PROCESSING_WIFI_CONFIG = 0x0102, /* RDK device is processing received WiFi configuration over Bluetooth LE */
59  BTRMGR_LE_ONBRDG_CONNECTING_TO_WIFI = 0x0103, /* RDK device is trying to connect to WiFi */
60  BTRMGR_LE_ONBRDG_WIFI_CONNECT_SUCCESS = 0x0104, /* RDK device is successfully associated to WiFi */
61  BTRMGR_LE_ONBRDG_ACQUIRING_IP_ADDRESS = 0x0105, /* RDK device is trying to acquire an IP post WiFi association */
62  BTRMGR_LE_ONBRDG_IP_ADDRESS_ACQUIRED = 0x0106, /* RDK device successfully acquired IP */
63  BTRMGR_LE_ONBRDG_DOWNLOADING_VIDEO_CONFIG = 0x0107, /* RDK device(camera) is downloading video configuration */
64  BTRMGR_LE_ONBRDG_CONFIGURING_LIVE_VIDEO = 0x0108, /* RDK device(camera) is configuring live video */
65  BTRMGR_LE_ONBRDG_FIRMWARE_UPGRADE = 0x09FE, /* RDK device has a critical firmware upgrade.After this, there wont be any more notifications sent via BLE interface. */
66  BTRMGR_LE_ONBRDG_COMPLETE_SUCCESS = 0x09FF, /* Provisioning / Onboarding of RDK device is completed successfully.This would be the last provisioning status from RDK device in case of successful completion. */
67 }BTRMGR_LeOnbrdg_WifiPrvsnStatus;
68 
69 typedef enum _BTRMGR_LeOnbrdg_state_t {
70  BTRMGR_LE_ONBRDG_UNDEFINED = 0,
71  BTRMGR_LE_ONBRDG_ADVERTISE,
72  BTRMGR_LE_ONBRDG_BT_PAIRING,
73  BTRMGR_LE_ONBRDG_INPROGRESS,
74  BTRMGR_LE_ONBRDG_GET_LFAT,
75  BTRMGR_LE_ONBRDG_GET_WIFI_CREDS,
76  BTRMGR_LE_ONBRDG_CONNECT_WIFI,
77  BTRMGR_LE_ONBRDG_COMPLETE,
78  BTRMGR_LE_ONBRDG_EXIT
79 }BTRMGR_LeOnbrdg_state;
80 
81 
82 /* wifi credntials structure */
84  char ssid[SSID_MAX_LEN + 1];
85  char passphrase[PASS_PHRASE_LEN + 1];
86  char frequency[MAX_FREQ_STR_LEN + 1];
87  int securitymode;
88 };
89 
90 /* Interfaces */
91 /**
92  * @addtogroup LE_DiagInfo
93  * @{
94  *
95  */
96 
97 eBTRMgrRet BTRMGR_LeOnboarding_GetData(BTRMGR_LeOnboardingChar_t aenLeOnboardingChar, char* aData);
98 eBTRMgrRet BTRMGR_LeOnboarding_SetData(BTRMGR_LeOnboardingChar_t aenLeOnboardingChar, char* payload);
99 
100 eBTRMgrRet BTRMGR_Wifi_ConnectToWifi(char* aSSID, char* aPassword, int aSecurityMode);
101 
102 /** @} */
103 
104 #endif /* __BTR_MGR_LEONBOARDING_H__ */
105 
eBTRMgrRet
enum _eBTRMgrRet eBTRMgrRet
Represents the bluetooth manager return values.
wifi_credentials
Definition: btrMgr_LEOnboarding.h:83