微 网 高 通

测试例程:基站接口管理
来源: | 作者:微网高通 | 发布时间: 2025-08-30 | 3 次浏览 | 分享到:

测试例程:基站接口管理

#include <stdio.h>
#include <Winsock2.h>
#include "API-WiMinet.h"
int main( int argc, char* argv[] )
{
   char iRetVal;
   char pX64MAC[0X08];
   char buffer[0X10];
   char * pAddr;
   struct in_addr addr;
   unsigned __int64 qwX64INT;
   // =================== GetHostViaX64INT ===================
   //
   // The int64 value
   //
   // (1) X64INT = 0X24E4C303556B5917
   // (2) X64INT = 0X24E4C303556B5917UL
   // (3) X64INT = 0X24E4C303556B591ul
   // (4) X64INT = 0X24E4C303556B5917i64
   //
   qwX64INT = 0X24E4C303556B5917;
   // Get the address value
   addr.S_un.S_addr = GetHostViaX64INT( qwX64INT, buffer, sizeof( buffer ) );
   // Translate to a.b.c.d format IP address
   pAddr = inet_ntoa( addr );
   // The IP address-1 information
   printf( "IP address-1=%srn", pAddr );
 
   // The IP address information
   printf( "IP address-2=%srnrn", buffer );
   // =================== GetHostViaX64STR ===================
   //
   // The X64String value
   //
   // (1) X64STR="24E4C303556B5917"
   // (2) X64STR="0X24E4C303556B5917"
   // (3) X64XTR="0x24E4C303556B5917"
   //
   // Get the address value
   addr.S_un.S_addr = GetHostViaX64STR( "24E4C303556B5917", buffer, sizeof( buffer ) );
 
   // Translate to a.b.c.d format IP address
   pAddr = inet_ntoa( addr );
 
   // The IP address-1 information
   printf( "IP address-3=%srn", pAddr );
 
   // The IP address information
   printf( "IP address-4=%srnrn", buffer );
   // =================== GetHostViaX64MAC ===================
   //
   // X64MAC:HEX for decimal value
   //
   // The X64MAC address
   pX64MAC[0X00] = ( char )0X24;
   pX64MAC[0X01] = ( char )0XE4;
   pX64MAC[0X02] = ( char )0XC3;
   pX64MAC[0X03] = ( char )0X03;
   pX64MAC[0X04] = ( char )0X55;
   pX64MAC[0X05] = ( char )0X6B;
   pX64MAC[0X06] = ( char )0X59;
   pX64MAC[0X07] = ( char )0X17;
 
   // Get the address value
   addr.S_un.S_addr = GetHostViaX64MAC( pX64MAC, buffer, sizeof( buffer ) );
 
   // Translate to a.b.c.d format IP address
   pAddr = inet_ntoa( addr );
 
   // The IP address-1 information
   printf( "IP address-5=%srn", pAddr );
 
   // The IP address information
   printf( "IP address-6=%srnrn", buffer );
 
   // Ethernet interface
   iRetVal = OpenWiMinetShell( buffer,12580, 0X01 );
   // Validate the shell open interface
   if ( !iRetVal )
   {
      printf( "Open shell FAILED!rn" );
      return 0X00;
   }
   // The open shell status
   printf( "Open shell SUCCESS!rnrn" );
 
   // Stop the shell
   StopWiMinetShell( 0X00 );
 
   // Exit this main program
   return 0X01;
}


点击下载:测试例程:基站接口管理