Example
#include <stdio.h> #include "mmsultra.h"
void main(void)
{
PRINTINIT pConfig; short sStatus = 0; unsigned short usStatus = 0;
sStatus = pclInit(NULL);
//Print data structure
//Status of comm. calls
//Battery level
// Start Print subsystem
if (sStatus != 0)
printf("Init Failed\nError: %d", sStatus);
else |
|
{ | // Get the battery level |
usStatus = pclGetBatteryLevel(); | |
if (usStatus <= 711) | // Display results |
printf("Charge the battery"); |
|
else |
|
if (usStatus >= 832) |
|
printf("Can run and print"); |
|
else |
|
printf("Can run/cannot print"); |
|
} | // Close Print subsystem |
pclClose(); |
}