hilink_open_nan_adapter.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright (c) Huawei Technologies Co., Ltd. 2020-2021. All rights reserved.
  3. * Description: 系统适配层内存接口(需设备厂商实现)
  4. */
  5. #ifndef HILINK_OPEN_MEM_ADAPTER_H
  6. #define HILINK_OPEN_MEM_ADAPTER_H
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. /*
  11. * WIFI感知底层驱动初始化
  12. * 返回0表示成功,返回-1表示失败
  13. */
  14. int HILINK_NanInit(void);
  15. /*
  16. * WIFI感知底层驱动去初始化
  17. * 返回0表示成功,返回-1表示失败
  18. */
  19. int HILINK_NanUninit(void);
  20. /*
  21. * WIFI感知启动订阅服务
  22. * 返回0表示成功,返回-1表示失败
  23. */
  24. int HILINK_NanStartSubscribe(const char *serviceName, unsigned char localHandle, void *handle);
  25. /*
  26. * WIFI感知停止订阅服务
  27. * 返回0表示成功,返回-1表示失败
  28. */
  29. int HILINK_NanStopSubscribe(unsigned char localHandle);
  30. /*
  31. * WIFI感知发包接口
  32. * 返回0表示成功,返回-1表示失败
  33. */
  34. int HILINK_NanSendPacket(unsigned char *macAddr, unsigned char peerHandle, unsigned char localHandle,
  35. unsigned char *msg, int len);
  36. /*
  37. * WIFI感知切换到超短距状态
  38. * 返回0表示成功,返回-1表示失败
  39. */
  40. int HILINK_NanSwitchSafeDistance(void);
  41. /*
  42. * WIFI感知切换到正常天线状态
  43. * 返回0表示成功,返回-1表示失败
  44. */
  45. int HILINK_NanSwitchNormalDistance(void);
  46. /*
  47. * beacon帧开启和关闭
  48. * 返回0表示成功,返回-1表示失败
  49. */
  50. int HILINK_NanBeaconSwitch(unsigned char enable);
  51. int HILINK_SoftApDeauthStation(const unsigned char *mac, unsigned char len);
  52. typedef enum {
  53. EVT_AP_START = 1,
  54. EVT_STA_CONNECT,
  55. EVT_STA_DISCONNECT
  56. } SoftApEventType;
  57. typedef struct {
  58. char addr[6]; //Quectel larson.li MAC_ADDRESS_LEN 宏定义找不到,根据经验MAC LEN为6
  59. } EventStaConnect;
  60. typedef struct {
  61. unsigned char addr[6];//Quectel larson.li MAC_ADDRESS_LEN 宏定义找不到,根据经验MAC LEN为6
  62. unsigned short reasonCode;
  63. } EventStaDisconnect;
  64. typedef union {
  65. EventStaConnect staConnect;
  66. EventStaDisconnect staDisconnect;
  67. } SoftApEventInfo;
  68. typedef struct {
  69. SoftApEventType type;
  70. SoftApEventInfo info;
  71. } SoftApEvent;
  72. typedef void (*SoftApEventCallback)(const SoftApEvent *event);
  73. /* 注册SoftAP事件处理回调函数 */
  74. void HILINK_RegSoftApEventCallback(SoftApEventCallback callback);
  75. #ifdef __cplusplus
  76. }
  77. #endif
  78. #endif