nerves-networking / vintage_net_mobile

Mobile networking for VintageNet
Apache License 2.0
27 stars 11 forks source link

Add sim selection to sierra modem #67

Closed mobileoverlord closed 4 years ago

mobileoverlord commented 4 years ago

The sierra HL8548 modem supports dual sim selection. You can enable this feature by passing sim_select: mode in the configuration.

The options are 0 Disable SIM selection. 1 Force to select the first external SIM. The presence of a second external SIM will be ignored. 2 Force to select the second external SIM. The presence of a first external SIM will be ignored. 3 Select the first external SIM if present else select the second external SIM 4 Read the SIM presence status

fhunleth commented 4 years ago

I'd think that it would be preferable to use atoms rather than numbers here.

Another option would be to add a trapdoor in the config for passing arbitrary chatscript commands to the scripts. Then stuff like this could be added without needing to figure out an appropriate API since future changes without migrations are breaking.

mobileoverlord commented 4 years ago

Another option would be to add a trapdoor in the config for passing arbitrary chatscript commands to the scripts.

I imagine that this would be useful across all modems, I think the best place would be to add an "after_prologue" script addition considering that some modems would not use the default chatscript, but they would all have some sort of prologue.

fhunleth commented 4 years ago

Yes, and the modems that don't use the default chatscript can be refactored to prepend their additions to any user-provided ones and start using the default chatscript function again. I think it's a win all around.

fhunleth commented 4 years ago

See #67.