С запуском точки доступа разобрался.
Сделал через скрипты.
Собрал проект на основе примера из wifi_ap (пример из установочника Bluegiga_wifi-1.2.2-63.exe).
Примеры, скачанные с сайта Bluegiga, почему-то не захотели работать.
На приём данные проходят (endpoint_data), а вот на передачу нет (endpoint_send).
Ответных пакетов не видно даже в сниффере.
Ещё также обнаружил странный момент, remote_ip из функции tcpip_endpoint_status всегда равен 0.
Хотя вроде бы он должен содержать адрес компьютера, с которого приходят пакеты.
CODE
const RA = 0
const RB = 1
const RC = 2
const RD = 3
const RE = 4
const RF = 5
const RG = 6
dim ap_channel
dim ap_security
dim ap_ssid(32)
dim ap_ssid_len
dim ap_password(32)
dim ap_password_len
dim ap_max_clients
dim ap_udp_uart_endpoint
dim ap_udp_port_1
dim ap_udp_endpoint_1
dim ap_udp_port_2
dim ap_udp_endpoint_2
event system_boot(major, minor, patch, build, bootloader_version, tcpip_version, hw)
ap_udp_uart_endpoint = 1
ap_channel = 11
ap_security = 2
ap_ssid_len = 11
ap_ssid(0:ap_ssid_len) = "Wi-Fi--UART"
ap_password_len = 16
ap_password(0:ap_password_len) = "Wi-Fi--CycloneIV"
ap_max_clients = 5
ap_udp_port_1 = 1000
ap_udp_endpoint_1 = 0
ap_udp_port_2 = 1024
ap_udp_endpoint_2 = 1
call system_set_max_power_saving_state(0)
call hardware_io_port_config_direction(RD, $0831, $0000)
call hardware_io_port_write(RD, $0831, $0000)
call hardware_io_port_config_direction(RE, $0001, $0000)
call hardware_io_port_write(RE, $0001, $0000)
call sme_set_operating_mode(2)
call sme_set_ap_max_clients(ap_max_clients)
call sme_set_ap_password(ap_password_len, ap_password(0:ap_password_len))
call sme_set_password(ap_password_len, ap_password(0:ap_password_len))
# ON RD4 "WF121 BOOT"
call hardware_io_port_write(RD, $0010, $0010)
end
event sme_wifi_is_on(state)
# ON RD0 "WF121 WIFI"
call hardware_io_port_write(RD, $0001, $0001)
call tcpip_configure(192.168.1.1, 255.255.255.0, 192.168.1.1, 0)
call sme_start_ap_mode(ap_channel, ap_security, ap_ssid_len, ap_ssid(0:ap_ssid_len))
end
event sme_wifi_is_off(state)
# OFF RD0 "WF121 WIFI"
call hardware_io_port_write(RD, $0001, $0000)
end
event sme_ap_mode_started(hw_interface)
# ON RD11 "WF121 AP"
call hardware_io_port_write(RD, $0800, $0800)
call https_enable(0, 1, 0)
call tcpip_start_udp_server(ap_udp_port_1, ap_udp_uart_endpoint)
call tcpip_start_udp_server(ap_udp_port_2, ap_udp_uart_endpoint)
end
event sme_ap_mode_failed(reason, hw_interface)
# ON RD5 "WF121 ERROR", OFF RD11 "WF121 AP"
call hardware_io_port_write(RD, $0820, $0020)
end
event sme_ap_mode_stopped(hw_interface)
# OFF RD11 "WF121 AP"
call hardware_io_port_write(RD, $0800, $0000)
end
event tcpip_endpoint_status(endpoint, local_ip, local_port, remote_ip, remote_port)
if local_port = ap_udp_port_1 && remote_ip != 0
ap_udp_endpoint_1 = endpoint
end if
if local_port = ap_udp_port_2 && remote_ip != 0
ap_udp_endpoint_2 = endpoint
end if
end
event endpoint_status(endpoint, type, streaming, destination, active)
if endpoint = ap_udp_endpoint_1 && active = 1
call endpoint_set_streaming_destination(ap_udp_uart_endpoint, endpoint)
call endpoint_set_streaming_destination(endpoint, ap_udp_uart_endpoint)
end if
if endpoint = ap_udp_endpoint_2 && active = 1
call endpoint_set_streaming_destination(ap_udp_uart_endpoint, endpoint)
call endpoint_set_streaming_destination(endpoint, ap_udp_uart_endpoint)
end if
end
Кто работал с WF121, отзовитесь
Уже две недели пытаюсь заставить работать этот гребаный модуль