sdk-hwV1.3/external/eyesee-mpp/system/public/smartlink/smartlink.h

121 lines
3.9 KiB
C
Raw Normal View History

2024-05-07 10:09:20 +00:00
/************************************************************************************************/
/* Copyright (C), 2001-2017, Allwinner Tech. Co., Ltd. */
/************************************************************************************************/
/**
* @file smartlink.h
* @brief
* @author id: guixing
* @version v0.1
* @date 2017-02-14
*/
#ifndef _SMARTLINK_H_
#define _SMARTLINK_H_
/************************************************************************************************/
/* Include Files */
/************************************************************************************************/
#include <errno.h>
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
/************************************************************************************************/
/* Macros & Typedefs */
/************************************************************************************************/
//#define SMARTLINK_DEBUG
#define SMARTLINK_ERROR
/************************************************************************************************/
/* Structure Declarations */
/************************************************************************************************/
typedef enum tag_SMARTLINK_AP_SECURITY_E
{
AP_SECURITY_OPEN = 0,
AP_SECURITY_WEP,
AP_SECURITY_WPA,
AP_SECURITY_BOTTON
} SMARTLINK_AP_SECURITY_E;
typedef struct tag_SMARTLINK_AP_S {
char ssid[32];
char psswd[64];
SMARTLINK_AP_SECURITY_E security;
unsigned char random_num;
} SMARTLINK_AP_S;
/************************************************************************************************/
/* Global Variables */
/************************************************************************************************/
/* None */
/************************************************************************************************/
/* Function Declarations */
/************************************************************************************************/
/**
* @brief wifi芯片为monitor模式或normal模式
* @param
* - wifi_name 线
* - monitor_enable 使monitor模式. 1:使monitor 2:monitor
* @return
* - 0
* - -1
*/
int set_wifi_monitor(const char *wifi_name, int monitor_enable);
/**
* @brief Smartlink发送wifi信道操作
* @param
* - wifi_name 线
* - lock_time_out ,ms,30*1000ms
* - chn_parser_time ,ms, 100ms
* @return
* - 0
* - -1
*/
int lock_smartlink_wifi_chn(const char *wifi_name, int lock_time_out, int chn_parser_time);
/**
* @brief Smartlink发送过来的数据包ssid, psswd以及用于结果返回的随机数值
* @param
* - wifi_name 线
* - time_out ,ms,20*1000ms
* - ap_info
* @return
* - 0
* - -1
*/
int parser_smartlink_config(const char *wifi_name, int time_out, SMARTLINK_AP_S *ap_info);
/**
* @brief smartlink数据中的随机数返回,,:AP后才能调用.
* @param
* - random_num smartlink数据中的随机数
* @return
* - 0
* - -1
*/
int send_broadcast_val(unsigned char random_num);
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif /* _SMARTLINK_H_ */