| 88 | } |
| 89 | |
| 90 | bool PhysicalStatus::createEntry(const L2LogicalChannel* chan) |
| 91 | { |
| 92 | assert(mDB); |
| 93 | assert(chan); |
| 94 | |
| 95 | ScopedLock lock(mLock); |
| 96 | |
| 97 | const char* chanString = chan->descriptiveString(); |
| 98 | LOG(DEBUG) << chan->descriptiveString(); |
| 99 | |
| 100 | /* Check to see if the key exists. */ |
| 101 | if (!sqlite3_exists(mDB, "PHYSTATUS", "CN_TN_TYPE_AND_OFFSET", chanString)) { |
| 102 | /* No? Ok, it should now. */ |
| 103 | char query[500]; |
| 104 | sprintf(query, "INSERT INTO PHYSTATUS (CN_TN_TYPE_AND_OFFSET, ACCESSED) VALUES " |
| 105 | "(\"%s\", %u)", |
| 106 | chanString, (unsigned)time(NULL)); |
| 107 | return sqlite3_command(mDB, query); |
| 108 | } |
| 109 | |
| 110 | return false; |
| 111 | } |
| 112 | |
| 113 | bool PhysicalStatus::setPhysical(const L2LogicalChannel* chan, |
| 114 | const L3MeasurementResults& measResults) |
nothing calls this directly
no test coverage detected