#include <stdio.h>
void deviceManagerExample()
{
printf("Example Program which creates a Device, and queries for it\n");
myDeviceManager.
Add(0x80C0001);
myDeviceManager.
Add(0x80C0002);
myDeviceManager.
Add(0x80C0003);
myDevice = myDeviceManager.
Add(0x80C0004);
printf(
"Last inserted id was 0x%08X\n",myDevice->
ID);
printf("Changing the dBm value to 32 and then we try to add the same device again\n");
myDevice = myDeviceManager.
Add(0x80C0004);
printf(
"Id is: 0x%08X dBm %d\n",myDevice->
ID,myDevice->
dBm);
myDevice = myDeviceManager.
Get(0x80C0002);
printf(
"ID should be 0x80C0002 and the ID is 0x%08X\n",myDevice->
ID);
myDevice = myDeviceManager.
Get(0x80C0005);
printf("This should not happen, as we get a NULL pointer if the device doesn't exist\n");
else
printf("The device 0x80C0005 does not exist!\n");
myDeviceManager.
Remove(0x80C0004);
myDevice = myDeviceManager.
Get(0x80C0004);
printf("And this also does not happen\n");
else
printf("The device 0x80C0004 has been deleted!\n");
}