@@ -11,6 +11,7 @@ int osmosap_sapsocket(struct osmocom_ms *ms, const char *path);
int osmosap_init(struct osmocom_ms *ms);
enum osmosap_state {
+ SAP_SOCKET_ERROR,
SAP_NOT_CONNECTED,
SAP_IDLE,
SAP_CONNECTION_UNDER_NEGOTIATION,
@@ -515,7 +515,8 @@ int sap_open(struct osmocom_ms *ms, const char *socket_path)
rc = connect(ms->sap_wq.bfd.fd, (struct sockaddr *) &local, sizeof(local));
if (rc < 0) {
fprintf(stderr, "Failed to connect to '%s'\n", local.sun_path);
- set->sap_socket_path[0] = 0;
+ // set->sap_socket_path[0] = 0;
+ ms->sap_entity.sap_state == SAP_SOCKET_ERROR;
close(ms->sap_wq.bfd.fd);
return rc;
}
@@ -188,7 +188,7 @@ static int sim_apdu_send(struct osmocom_ms *ms, uint8_t *data, uint16_t length)
/* adding SAP client support
* it makes more sense to do it here then in L1CTL */
- if(ms->settings.sap_socket_path[0] == 0) {
+ if(ms->sap_entity.sap_state == SAP_SOCKET_ERROR) {
LOGP(DSIM, LOGL_INFO, "Using built-in SIM reader\n");
l1ctl_tx_sim_req(ms, data, length);
} else {
@@ -1067,7 +1067,7 @@ DEFUN(cfg_no_gps_enable, cfg_no_gps_enable_cmd, "no gps enable",
}
#ifdef _HAVE_GPSD
-DEFUN(cfg_gps_host, cfg_gps_host_cmd, "gps host HOST:PORT",
+DEFUN(cfg_gps_host, cfg_gps_host_cmd, "gpsd host HOST:PORT",
"GPS receiver\nSelect gpsd host and port\n"
"IP and port (optional) of the host running gpsd")
{
@@ -1499,8 +1499,7 @@ static int config_write(struct vty *vty)
struct osmocom_ms *ms;
#ifdef _HAVE_GPSD
- vty_out(vty, "gpsd host %s%s", g.gpsd_host, VTY_NEWLINE);
- vty_out(vty, "gpsd port %s%s", g.gpsd_port, VTY_NEWLINE);
+ vty_out(vty, "gpsd host %s:%s%s", g.gpsd_host, g.gpsd_port, VTY_NEWLINE);
#endif
vty_out(vty, "gps device %s%s", g.device, VTY_NEWLINE);
if (g.baud)