Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
Diff: apndb.cpp
- Revision:
- 23:0a48eebaaba8
- Child:
- 28:2004400abeec
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/apndb.cpp Mon Mar 24 09:58:46 2014 +0000
@@ -0,0 +1,34 @@
+#include "apndb.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "string.h"
+
+#define APNDB_COUNT 5
+
+// Contains all tuples
+apndb_t apndb[] = {
+ { .mcc = "123", .mnc = "023", .apn = "apn", .user = "user", .pass = "" },
+ { .mcc = "123", .mnc = "023", .apn = "apn", .user = "user", .pass = "" },
+ { .mcc = "204", .mnc = "04", .apn = "Vodafone NL", .user = "user", .pass = "" },
+ { .mcc = "123", .mnc = "023", .apn = "apn", .user = "user", .pass = "" },
+ { .mcc = "123", .mnc = "023", .apn = "apn", .user = "user", .pass = "" }
+};
+
+apndb_t * apndb_get(const char * imsi)
+{
+ char chr1[8], chr2[8];
+ size_t len;
+
+ for (size_t i = 0; i < APNDB_COUNT; i++) {
+ strcpy(chr1, apndb[i].mcc);
+ strcat(chr1, apndb[i].mnc);
+ len = strlen(chr1);
+ strncpy(chr2, imsi, len);
+ chr2[len] = '\0';
+
+ if (strcmp(chr1, chr2) == 0)
+ return &apndb[i];
+ }
+
+ return NULL;
+}

Cumulocity