페이지 선택
Generic selectors
Exact matches only
Search in title
Search in content
Search in pages

EasyLink SDK for iOS

 

 

1. The main features of the EasyLink SDK

 

♦  Send Wi-Fi network parameters set on the mobile terminal to the device side

* Support EasyLink mode      * Support Soft AP mode      * Support packet encryption

 

♦ Go to new networked devices and interact. Implement parameter settings, OTA and other functions

Note that EasyLink mode only supports operations on IPv4 networks.

 

 

 

2. API usage

EasyLink’s usage flow is:  Initialize EasyLink instance → Set configuration parameters → Start sending distribution network information

→ Wait for new device discovery callback → Stop sending distribution network information → If you do not need to configure again, destroy EasyLink instance.

 

 

♦ Step1

Initialize the EasyLink instance

– (id)initForDebug:(BOOL)enable WithDelegate:(id)delegate;

 

 

♦ Step2

Set configuration parameters

– (void)prepareEasyLink:(NSDictionary *)wlanConfigDict info:(NSData *)userInfo mode:(EasyLinkMode)easyLinkMode encrypt:(NSData *)key;

 

EasyLink distribution mode: easyLinkMode

⊗ 특별한 경우가 아니면 Easylink 모드로 EASYLINK_AWS 를 선택한다.

Typedef enum{         

EASYLINK_V1 = 0,         

EASYLINK_V2,         

EASYLINK_PLUS,        

EASYLINK_V2_PLUS,         

EASYLINK_AWS,         

EASYLINK_SOFT_AP,        

EASYLINK_MODE_MAX,    

 } EasyLinkMode;

 

wlanConfig dictionary content

#define KEY_SSID @”SSID”

method, otherwise the wireless network containing Chinese characters cannot be properly configured.    

#define KEY_PASSWORD @”PASSWORD” //value type: NSString or NSData, wireless network password    

 #define KEY_DHCP @”DHCP”

an IP address (DHCP is enabled), @YES or @NO, EASYLINK_AWS distribution network must use @YES    

#define KEY_IP @”IP” //value type: NSString, IP address, if DHCP is enabled, you can leave it blank, EASYLINK_AWS distribution network does not support     

#define KEY_NETMASK @”NETMASK” //value type: NSString, subnet mask, if DHCP is enabled, you can leave it blank, EASYLINK_AWS distribution network does not support    

#define KEY_GATEWAY @”GATEWAY” //value type: NSString, gateway, if DHCP is enabled, you can leave it blank, EASYLINK_AWS distribution network does not support    

#define KEY_DNS1 @”DNS1″ //value type: NSString, DNS server 1, if DHCP is enabled, you can leave it blank, EASYLINK_AWS distribution network does not support   

 #define KEY_DNS2 @”DNS2″ //value type: NSString, DNS server 2, if DHCP is enabled, you can leave it blank, EASYLINK_AWS distribution network does not support

 

 

♦ Step3

Start sending distribution network information

(void)transmitSettings;

 

 

♦ Step4

Callback waiting for new device discovery If the device is connected to the target network, the SDK can generate a callback.

EASYLINK AWS mode uses UDP broadcast implementation, and the rest of the distribution network uses mDNS. The service name is _easylink_config._tcp.

The specific implementation method has been implemented in the SDK, the application does not need to care

    – (void)onFound:(NSNumber *)client withName:(NSString *)name mataData: (NSDictionary *)mataDataDict;               

 

The onFoundByFTC callback is also triggered if the Config Server feature is enabled on the device.

    – (void)onFoundByFTC:(NSNumber *)client withConfiguration: (NSDictionary *)configDict;

If the onFoundByFTC callback is triggered, you can use the – (void)configFTCClient:(NSNumber *)client withConfiguration: (NSDictionary *)configDict; 

 

method to set the device parameters. But this feature also works with the Config Server feature on the device.

 

 

♦ Step5

Stop sending distribution network information If you think that the distribution network has been completed, you can stop sending distribution network information.

 (void)stopTransmitting;

 

 

♦ Step6

Destroy the EasyLink instance if you do not need to configure it again Use this method to completely remove the resources occupied by the easylink example.

(void)unInit;

 

 

3. Call Back 문제 해결

Bonjour services를 추가 한다. 아래 그림을 참조.

Bonjour services
Item 0 _easylink._tcp
Item 1 _easylink.config._tcp

 

 

Adsense

EMW3070

Viewed Page List