mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #11538 from mirelachirica/ipv6_to_wise_1570
Cellular: Enable IPV6 for WISE_1570pull/11547/head
commit
daafb950d9
|
@ -40,7 +40,7 @@ static const intptr_t cellular_properties[AT_CellularBase::PROPERTY_MAX] = {
|
|||
1, // AT_CMGF
|
||||
1, // AT_CSDH
|
||||
1, // PROPERTY_IPV4_STACK
|
||||
0, // PROPERTY_IPV6_STACK
|
||||
1, // PROPERTY_IPV6_STACK
|
||||
0, // PROPERTY_IPV4V6_STACK
|
||||
0, // PROPERTY_NON_IP_PDP_TYPE
|
||||
0, // PROPERTY_AT_CGEREP
|
||||
|
|
|
@ -142,9 +142,9 @@ nsapi_error_t QUECTEL_BC95_CellularStack::create_socket_impl(CellularSocket *soc
|
|||
bool socketOpenWorking = false;
|
||||
|
||||
if (socket->proto == NSAPI_UDP) {
|
||||
_at.cmd_start_stop("+NSOCR", "=DGRAM,", "%d%d%d", 17, socket->localAddress.get_port(), 1);
|
||||
_at.cmd_start_stop("+NSOCR", "=DGRAM,", "%d%d%d%s", 17, socket->localAddress.get_port(), 1, ((_ip_ver_sendto == NSAPI_IPv4) ? "AF_INET" : "AF_INET6"));
|
||||
} else if (socket->proto == NSAPI_TCP) {
|
||||
_at.cmd_start_stop("+NSOCR", "=STREAM,", "%d%d%d", 6, socket->localAddress.get_port(), 1);
|
||||
_at.cmd_start_stop("+NSOCR", "=STREAM,", "%d%d%d%s", 6, socket->localAddress.get_port(), 1, ((_ip_ver_sendto == NSAPI_IPv4) ? "AF_INET" : "AF_INET6"));
|
||||
} else {
|
||||
return NSAPI_ERROR_PARAMETER;
|
||||
}
|
||||
|
@ -173,6 +173,12 @@ nsapi_size_or_error_t QUECTEL_BC95_CellularStack::socket_sendto_impl(CellularSoc
|
|||
// open already.
|
||||
MBED_ASSERT(socket->id != -1);
|
||||
|
||||
if (_ip_ver_sendto != address.get_ip_version()) {
|
||||
_ip_ver_sendto = address.get_ip_version();
|
||||
socket_close_impl(socket->id);
|
||||
create_socket_impl(socket);
|
||||
}
|
||||
|
||||
int sent_len = 0;
|
||||
|
||||
if (size > PACKET_SIZE_MAX) {
|
||||
|
|
Loading…
Reference in New Issue