diff options
| author | HubretXie <[email protected]> | 2019-06-09 13:55:19 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-06-09 13:55:19 +0800 |
| commit | 5a5ea94928061548e5c59dd6cd070eaaeb347213 (patch) | |
| tree | 4d88994e08184bc0aa297dfc20c70ca3906d36b1 /components/net/at | |
| parent | 36ffdc058b3aeb447d74dd916c26e1dd80b80def (diff) | |
| parent | cf7052f6b7502c20f28eae5b9c096978c7f3a98f (diff) | |
Merge pull request #6 from RT-Thread/master
sync
Diffstat (limited to 'components/net/at')
| -rw-r--r-- | components/net/at/at_socket/at_socket.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/components/net/at/at_socket/at_socket.c b/components/net/at/at_socket/at_socket.c index a3b36a06ae..993ec33506 100644 --- a/components/net/at/at_socket/at_socket.c +++ b/components/net/at/at_socket/at_socket.c @@ -359,20 +359,21 @@ __err: return RT_NULL; } -static struct at_socket *alloc_socket(int domain) +static struct at_socket *alloc_socket(void) { extern struct netdev *netdev_default; struct netdev *netdev = RT_NULL; struct at_device *device = RT_NULL; - if (netdev_default && netdev_is_up(netdev_default)) + if (netdev_default && netdev_is_up(netdev_default) && + netdev_family_get(netdev_default) == AF_AT) { netdev = netdev_default; } else { - /* get network interface device by protocol family */ - netdev = netdev_get_by_family(domain); + /* get network interface device by protocol family AF_AT */ + netdev = netdev_get_by_family(AF_AT); if (netdev == RT_NULL) { return RT_NULL; @@ -414,7 +415,7 @@ int at_socket(int domain, int type, int protocol) } /* allocate and initialize a new AT socket */ - sock = alloc_socket(domain); + sock = alloc_socket(); if (sock == RT_NULL) { return -1; |
