diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-05-18 19:19:49 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-05-18 19:19:49 +0000 |
commit | aab0210d3c33296381cff7f988a30f75f058ae8c (patch) | |
tree | abc7c0b3f67c8d030006c8e9a0861d55e28d6471 /serial/storage.c | |
parent | 3568bdd8c1a21ba36e9baf0b1485a1960d1c566b (diff) |
serial: remove the entry from the persistent storage when RemovePort is called
Diffstat (limited to 'serial/storage.c')
-rw-r--r-- | serial/storage.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/serial/storage.c b/serial/storage.c index 89d156e5..e6d73827 100644 --- a/serial/storage.c +++ b/serial/storage.c @@ -38,6 +38,21 @@ #include "storage.h" +int port_delete(bdaddr_t *src, bdaddr_t *dst, int id) +{ + char filename[PATH_MAX + 1]; + char src_addr[18], dst_addr[18]; + char key[32]; + + ba2str(src, src_addr); + ba2str(dst, dst_addr); + + create_name(filename, PATH_MAX, STORAGEDIR, src_addr, "serial"); + snprintf(key, sizeof(key), "%s#%d", dst_addr, id); + + return textfile_del(filename, key); +} + int port_store(bdaddr_t *src, bdaddr_t *dst, int id, uint8_t ch, const char *svcname) { |