root@zerophone-prototype:~/ofono# diff plugins/sim800.c plugins/sim900.c 28d27 < #include 64c63 < struct sim800_data { --- > struct sim900_data { 71c70 < static int sim800_probe(struct ofono_modem *modem) --- > static int sim900_probe(struct ofono_modem *modem) 73c72 < struct sim800_data *data; --- > struct sim900_data *data; 77c76 < data = g_try_new0(struct sim800_data, 1); --- > data = g_try_new0(struct sim900_data, 1); 86c85 < static void sim800_remove(struct ofono_modem *modem) --- > static void sim900_remove(struct ofono_modem *modem) 88c87 < struct sim800_data *data = ofono_modem_get_data(modem); --- > struct sim900_data *data = ofono_modem_get_data(modem); 97c96 < static void sim800_debug(const char *str, void *user_data) --- > static void sim900_debug(const char *str, void *user_data) 107c106 < struct sim800_data *data = ofono_modem_get_data(modem); --- > struct sim900_data *data = ofono_modem_get_data(modem); 115,116c114 < if (device == NULL) { < DBG("couldn't get string %s",key); --- > if (device == NULL) 118d115 < } 123,124c120 < if (options == NULL) { < DBG("options is null"); --- > if (options == NULL) 126d121 < } 140,141c135 < if (channel == NULL){ < DBG("serial channel couldn't be opened"); --- > if (channel == NULL) 143d136 < } 153d145 < DBG("at channel couldn't be opened"); 159c151 < g_at_chat_set_debug(chat, sim800_debug, debug); --- > g_at_chat_set_debug(chat, sim900_debug, debug); 181,184c173,174 < if (getenv("OFONO_AT_DEBUG")) { < DBG("AT DEBUG enabled"); < g_at_chat_set_debug(chat, sim800_debug, debug); < } --- > if (getenv("OFONO_AT_DEBUG")) > g_at_chat_set_debug(chat, sim900_debug, debug); 189c179 < static void shutdown_device(struct sim800_data *data) --- > static void shutdown_device(struct sim900_data *data) 215c205 < struct sim800_data *data = ofono_modem_get_data(modem); --- > struct sim900_data *data = ofono_modem_get_data(modem); 228c218 < g_at_mux_set_debug(data->mux, sim800_debug, "MUX: "); --- > g_at_mux_set_debug(data->mux, sim900_debug, "MUX: "); 246a237 > 257c248 < struct sim800_data *data = ofono_modem_get_data(modem); --- > struct sim900_data *data = ofono_modem_get_data(modem); 267a259 > 271,274d262 < DBG("If you are on a SIM800H modem with firmware version lower \ < than ... CMUX command is not supported thus \ < preventing GPRS, Voice and SMS managers to be executed simultaneously."); < 282c270 < struct sim800_data *data = ofono_modem_get_data(modem); --- > struct sim900_data *data = ofono_modem_get_data(modem); 292,293d279 < DBG("sending CMUX"); < g_at_chat_send(data->dlcs[SETUP_DLC],"AT+CMUX=0,0,5,128,10,3,30,10,2", NULL,mux_setup_cb, modem, NULL); 294a281,283 > g_at_chat_send(data->dlcs[SETUP_DLC], > "AT+CMUX=0,0,5,128,10,3,30,10,2", NULL, > mux_setup_cb, modem, NULL); 297c286 < static int sim800_enable(struct ofono_modem *modem) --- > static int sim900_enable(struct ofono_modem *modem) 299c288 < struct sim800_data *data = ofono_modem_get_data(modem); --- > struct sim900_data *data = ofono_modem_get_data(modem); 304,305c293 < if (data->dlcs[SETUP_DLC] == NULL){ < DBG("couldn't open device"); --- > if (data->dlcs[SETUP_DLC] == NULL) 307d294 < } 309a297,301 > > /* For obtain correct sms service number */ > g_at_chat_send(data->dlcs[SETUP_DLC], "AT+CSCS=\"GSM\"", NULL, > NULL, NULL, NULL); > 319c311 < struct sim800_data *data = ofono_modem_get_data(modem); --- > struct sim900_data *data = ofono_modem_get_data(modem); 329c321 < static int sim800_disable(struct ofono_modem *modem) --- > static int sim900_disable(struct ofono_modem *modem) 331c323 < struct sim800_data *data = ofono_modem_get_data(modem); --- > struct sim900_data *data = ofono_modem_get_data(modem); 341c333 < static void sim800_pre_sim(struct ofono_modem *modem) --- > static void sim900_pre_sim(struct ofono_modem *modem) 343c335 < struct sim800_data *data = ofono_modem_get_data(modem); --- > struct sim900_data *data = ofono_modem_get_data(modem); 346c338 < DBG("%p %x", modem, data); --- > DBG("%p", modem); 349d340 < DBG("devinfo created"); 352d342 < DBG("sim created created"); 356,357d345 < < DBG("pre sim finished"); 360c348 < static void sim800_post_sim(struct ofono_modem *modem) --- > static void sim900_post_sim(struct ofono_modem *modem) 362c350 < struct sim800_data *data = ofono_modem_get_data(modem); --- > struct sim900_data *data = ofono_modem_get_data(modem); 368,373c356 < /* Dirty Hack : give some time to sim800 for multiplexing < * to be effective and avoid VOICE_DLC to be < * flooded thus leading to a "famine" situation < */ < < sleep(2); --- > ofono_phonebook_create(modem, 0, "atmodem", data->dlcs[VOICE_DLC]); 377d359 < 382c364 < gc = ofono_gprs_context_create(modem, OFONO_VENDOR_SIMCOM, --- > gc = ofono_gprs_context_create(modem, OFONO_VENDOR_SIMCOM_SIM900, 388c370 < static void sim800_post_online(struct ofono_modem *modem) --- > static void sim900_post_online(struct ofono_modem *modem) 390c372 < struct sim800_data *data = ofono_modem_get_data(modem); --- > struct sim900_data *data = ofono_modem_get_data(modem); 394d375 < ofono_phonebook_create(modem, 0, "atmodem", data->dlcs[VOICE_DLC]); 402,410c383,391 < static struct ofono_modem_driver sim800_driver = { < .name = "sim800", < .probe = sim800_probe, < .remove = sim800_remove, < .enable = sim800_enable, < .disable = sim800_disable, < .pre_sim = sim800_pre_sim, < .post_sim = sim800_post_sim, < .post_online = sim800_post_online, --- > static struct ofono_modem_driver sim900_driver = { > .name = "sim900", > .probe = sim900_probe, > .remove = sim900_remove, > .enable = sim900_enable, > .disable = sim900_disable, > .pre_sim = sim900_pre_sim, > .post_sim = sim900_post_sim, > .post_online = sim900_post_online, 413c394 < static int sim800_init(void) --- > static int sim900_init(void) 415c396 < return ofono_modem_driver_register(&sim800_driver); --- > return ofono_modem_driver_register(&sim900_driver); 418c399 < static void sim800_exit(void) --- > static void sim900_exit(void) 420c401 < ofono_modem_driver_unregister(&sim800_driver); --- > ofono_modem_driver_unregister(&sim900_driver); 423,424c404,405 < OFONO_PLUGIN_DEFINE(sim800, "SIM800 modem driver", VERSION, < OFONO_PLUGIN_PRIORITY_DEFAULT, sim800_init, sim800_exit) --- > OFONO_PLUGIN_DEFINE(sim900, "SIM900 modem driver", VERSION, > OFONO_PLUGIN_PRIORITY_DEFAULT, sim900_init, sim900_exit)