~modemmanager/modemmanager/MM_05

« back to all changes in this revision

Viewing changes to src/mm-plugin-base.c

  • Committer: Dan Williams
  • Date: 2012-08-24 02:23:29 UTC
  • Revision ID: git-v1:21e66dfa1774ac2ee037ac8b6e8bb4d71a6f7931
core: add function to open probe ports without removing echo

Some devices (Sierra GSM ones) return stuff we need but don't
bother to prefix it with <CR><LF>, so we need to optionally turn
off the echo removal at probe time.

Show diffs side-by-side

added added

removed removed

Lines of Context:
863
863
    return FALSE;
864
864
}
865
865
 
866
 
gboolean
867
 
mm_plugin_base_probe_port (MMPluginBase *self,
868
 
                           MMPluginBaseSupportsTask *task,
869
 
                           guint64 send_delay_us,
870
 
                           GError **error)
 
866
static gboolean
 
867
_internal_probe_port (MMPluginBase *self,
 
868
                      MMPluginBaseSupportsTask *task,
 
869
                      guint64 send_delay_us,
 
870
                      gboolean remove_echo,
 
871
                      GError **error)
871
872
{
872
873
    MMPluginBaseSupportsTaskPrivate *task_priv = MM_PLUGIN_BASE_SUPPORTS_TASK_GET_PRIVATE (task);
873
874
    MMAtSerialPort *serial;
894
895
                  MM_SERIAL_PORT_SEND_DELAY, send_delay_us,
895
896
                  MM_PORT_CARRIER_DETECT, FALSE,
896
897
                  MM_SERIAL_PORT_SPEW_CONTROL, TRUE,
 
898
                  MM_AT_SERIAL_PORT_REMOVE_ECHO, remove_echo,
897
899
                  NULL);
898
900
 
899
901
    mm_at_serial_port_set_response_parser (serial,
909
911
}
910
912
 
911
913
gboolean
 
914
mm_plugin_base_probe_port (MMPluginBase *self,
 
915
                           MMPluginBaseSupportsTask *task,
 
916
                           guint64 send_delay_us,
 
917
                           GError **error)
 
918
{
 
919
    return _internal_probe_port (self, task, send_delay_us, TRUE, error);
 
920
}
 
921
 
 
922
gboolean
 
923
mm_plugin_base_probe_port_leave_echo (MMPluginBase *self,
 
924
                                      MMPluginBaseSupportsTask *task,
 
925
                                      guint64 send_delay_us,
 
926
                                      GError **error)
 
927
{
 
928
    return _internal_probe_port (self, task, send_delay_us, FALSE, error);
 
929
}
 
930
 
 
931
gboolean
912
932
mm_plugin_base_get_cached_port_capabilities (MMPluginBase *self,
913
933
                                             GUdevDevice *port,
914
934
                                             guint32 *capabilities)