#include #include "RilMonitor.h" #include "RilExceptions.h" #include "debug.h" int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { DebugSetLogfile("tstimei.log"); rilmonitor m; try { DWORD state; requesthandler_ptr rs= m.GetEquipmentState(state); rs->wait(); if (rs->errorcode()) { debug("GetEquipmentState: error %08lx\n", rs->errorcode()); } std::string imei; rs= m.GetEquipmentInfo(imei); rs->wait(); if (rs->errorcode()) { debug("GetEquipmentInfo: error %08lx\n", rs->errorcode()); } std::string imsi; rs= m.GetUserIdentity(imsi); rs->wait(); if (rs->errorcode()) { debug("GetUserIdentity: error %08lx\n", rs->errorcode()); } debug("done\n"); } catch(ril_error& e) { debug("rilerr: %08lx: %s\n", e.err, e.name.c_str()); } catch(ril_structsize_error& e) { debug("rilsize: got %d, expected %d\n", e.got, e.expect); } catch(...) { debug("unknown exception\n"); } return 0; }