Implementation of MTK Elian (SmartLink) under WIN32

Source: Internet
Author: User

First explain the debugging skills: The program needs to implement the wireless network card, because the PC may be multi-network card (wired network card, wireless network card, virtual network card), so when the packet is not necessarily from the wireless network card, Lib library should also not handle the choice of multi-network card. So in the debugging need to put in addition to the wireless network card (wired network card, virtual network card) are disabled, the program in execution, there will be a lot of data through the network port, so you can also see through the Wireshark network card port whether there is data access, as long as the following interface can be opened. Implementation code:
  1. #include <stdio.h>
  2. #include<string.h>
  3. #include"elian.h"
  4. #pragma comment(lib,"elian.lib")
  5. int main(int argc,char*argv[])
  6. {
  7. unsignedchar target[]={0xff,0xff,0xff,0xff,0xff,0xff};
  8. int ret =0;
  9. unsignedint flag = ELIAN_SEND_V4;
  10. void*handle = NULL;
  11. unsignedchar authmode =0x04;
  12. printf("Create elian Handle\n");
  13. handle = elianNew(NULL,0, target, ELIAN_SEND_V4);
  14. printf("Set TYPE_ID_AM\n");
  15. ret = elianPut(handle, TYPE_ID_AM,(char*)&authmode,1);
  16. printf("Set TYPE_ID_SSID ret=%d\n", ret);
  17. ret = elianPut(handle, TYPE_ID_SSID,"Rookie", strlen("Rookie"));
  18. printf("Set TYPE_ID_PWD ret=%d\n", ret);
  19. ret = elianPut(handle, TYPE_ID_PWD,"123123123", strlen("123123123"));
  20. printf("Set TYPE_ID_CUST ret=%d\n", ret);
  21. ret = elianPut(handle, TYPE_ID_CUST,"aaaaaaa", strlen("aaaaaaa"));
  22. printf("elianStart ret=%d\n", ret);
  23. elianStart(handle);
  24. getchar();
  25. elianStop(handle);
  26. elianDestroy(handle);
  27. }
Specify the Elian.lib library path:



From for notes (Wiz)



Implementation of MTK Elian (SmartLink) under WIN32

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.