Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
example.cpp
00001 #ifdef COMPILE_LLDP_TEXT 00002 00003 #include "mbed.h" 00004 #include "LLDP.h" 00005 00006 Serial pc(USBTX, USBRX); 00007 DigitalOut myled(LED1); 00008 LLDP lldp; 00009 00010 int main() { 00011 char test[256]; 00012 int j, k; 00013 00014 pc.baud(115200); 00015 00016 pc.printf("Chassis type = %d\r\n", lldp._chassis.base.header.getType()); 00017 pc.printf("Chassis len = %d\r\n", lldp._chassis.base.header.getLength()); 00018 for (j = 0, k = lldp._chassis.copy(test); j < k; j++) pc.printf("%02X ", test[j]); 00019 pc.printf("\r\n"); 00020 00021 pc.printf("Port type = %d\r\n", lldp._port.base.header.getType()); 00022 pc.printf("Port len = %d\r\n", lldp._port.base.header.getLength()); 00023 for (j = 0, k = lldp._port.copy(test); j < k; j++) pc.printf("%02X ", test[j]); 00024 pc.printf("\r\n"); 00025 00026 00027 pc.printf("Size is %d\r\n", lldp.buflen); 00028 for (int i = 0; i < lldp.buflen; i++) { 00029 pc.printf("%02X ", lldp.buffer[i]); 00030 } 00031 pc.printf("\r\nDone.\r\n"); 00032 00033 while(1) { 00034 myled = 1; 00035 wait(0.5); 00036 myled = 0; 00037 wait(0.5); 00038 lldp.broadcast(); 00039 } 00040 } 00041 00042 #endif
Generated on Wed Jul 13 2022 12:19:41 by
1.7.2