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
apndb.cpp
- Committer:
- Cumulocity
- Date:
- 2014-07-24
- Revision:
- 42:104746744af8
- Parent:
- 29:853741b9ea3b
- Child:
- 44:e34e48130533
File content as of revision 42:104746744af8:
#include "apndb.h"
#include "stdlib.h"
#include "stdio.h"
#include "string.h"
// Contains all tuples
apndb_t apndb[] = {
{ .mcc = "262", .mnc = "02", .carrier = "Telekom", .apn = "m2m.business" },
{ .mcc = "262", .mnc = "06", .carrier = "Telekom", .apn = "m2m.business" },
{ .mcc = "204", .mnc = "04", .carrier = "Vodafone NL", .apn = "public4.m2minternet.com" },
{ .mcc = NULL, .mnc = NULL, .carrier = NULL, .apn = NULL } // ending terminator
};
apndb_t * apndb_get(const char * imsi)
{
char chr1[8], chr2[8];
size_t len;
size_t i;
i = 0;
while (apndb[i].mcc != NULL) {
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];
i++;
}
return NULL;
}

Cumulocity