苹果电脑当无线WIFI热点用,手机通过电脑WIFI上网

1. 雷电接口连接Apple MacBook Pro ,另一头RJ45接口连接网络水晶头

 2.打开网络共享设置

 3.RJ45接口网络共享给WIFI设置

4.设置wifi密码与wifi名

 

5. WIF热点设置成功

 

 6. iPhone手机打开无线网络,可搜索到WIFI : Hacker's MacBook Pro

 7.输入WIFI密码然后点击加入

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
以下是一个基本的FPGA与电脑之间通过WiFi模块实现无线通信的代码示例。这里以使用Digilent Pmod WiFi模块的Xilinx Spartan 6 FPGA为例,但是这个例子也可以适用于其他WiFi模块和FPGA平台。 1. 首先,我们需要使用VHDL编写FPGA的代码。以下是一个简单的VHDL例子,它使用Digilent Pmod WiFi模块与电脑进行通信: ```vhdl library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity wifi_communication is Port ( clock : in STD_LOGIC; reset : in STD_LOGIC; tx_data : in STD_LOGIC_VECTOR (7 downto 0); rx_data : out STD_LOGIC_VECTOR (7 downto 0); tx_en : in STD_LOGIC; rx_en : in STD_LOGIC; tx_done : out STD_LOGIC; rx_done : out STD_LOGIC; wifi_rx : in STD_LOGIC; wifi_tx : out STD_LOGIC; wifi_rts : out STD_LOGIC; wifi_cts : in STD_LOGIC); end wifi_communication; architecture Behavioral of wifi_communication is signal tx_state : integer range 0 to 2 := 0; signal tx_data_reg : std_logic_vector(7 downto 0); signal tx_counter : integer range 0 to 7 := 0; signal rx_state : integer range 0 to 2 := 0; signal rx_data_reg : std_logic_vector(7 downto 0); signal rx_counter : integer range 0 to 7 := 0; signal wifi_rx_reg : std_logic_vector(7 downto 0); signal wifi_tx_reg : std_logic_vector(7 downto 0); signal wifi_rts_reg : std_logic := '0'; signal wifi_cts_reg : std_logic := '0'; begin tx_done <= '1' when (tx_state = 0) else '0'; rx_done <= '1' when (rx_state = 0) else '0'; process(clock, reset) begin if reset = '1' then tx_state <= 0; tx_data_reg <= (others => '0'); tx_counter <= 0; rx_state <= 0; rx_data_reg <= (others => '0'); rx_counter <= 0; wifi_rx_reg <= (others => '0'); wifi_tx_reg <= (others => '0'); wifi_rts_reg <= '0'; wifi_cts_reg <= '0'; elsif rising_edge(clock) then -- Transmit state machine case tx_state is when 0 => if tx_en = '1' then tx_state <= 1; tx_data_reg <= tx_data; end if; when 1 => wifi_rts_reg <= '1'; if wifi_cts = '1' then tx_state <= 2; wifi_tx_reg <= tx_data_reg; end if; when 2 => wifi_rts_reg <= '0'; if wifi_cts = '1' then tx_counter <= tx_counter + 1; if tx_counter = 7 then tx_state <= 0; else tx_data_reg <= tx_data_reg(6 downto 0) & '0'; end if; end if; end case; -- Receive state machine case rx_state is when 0 => if rx_en = '1' and wifi_rx = '1' then rx_state <= 1; end if; when 1 => wifi_rts_reg <= '1'; if wifi_cts = '1' then rx_state <= 2; wifi_rts_reg <= '0'; end if; when 2 => wifi_rts_reg <= '0'; if wifi_rx = '1' then rx_counter <= rx_counter + 1; if rx_counter = 7 then rx_state <= 0; rx_data_reg <= wifi_rx_reg; else wifi_rx_reg <= wifi_rx_reg(6 downto 0) & '0'; end if; end if; end case; wifi_tx <= wifi_tx_reg; wifi_rts <= wifi_rts_reg; rx_data <= rx_data_reg; end if; end process; end Behavioral; ``` 2. 接下来,我们需要使用C或者Python编写电脑端的代码,以与FPGA通信。以下是一个简单的Python例子,它使用Python的socket库与FPGA进行通信: ```python import socket HOST = '192.168.1.100' # FPGA的IP地址 PORT = 5000 # 与FPGA通信的端口号 while True: try: # 创建一个TCP/IP套接字 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # 连接FPGA sock.connect((HOST, PORT)) # 发送数据到FPGA sock.sendall(b'Hello, FPGA!') # 接收来自FPGA的响应 data = sock.recv(1024) print('Received:', data) # 关闭套接字 sock.close() except Exception as e: print(e) ``` 请注意,这只是一个简单的例子。实际的代码可能需要更复杂的错误处理和数据处理。此外,还需要确保FPGA和电脑都连接到同一个WiFi网络,并且FPGA的IP地址正确设置。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

林鸿群

有你的鼓励,我会更加努力。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值