LwIP

Started by tha, August 29, 2021, 09:15:30 AM

Previous topic - Next topic

tha

https://www.nongnu.org/lwip/2_1_x/group__lwip__os.html



Detailed Description

ใช้โหมดนี้ถ้าคุณรัน an OS บนระบบของคุณ. ขอแนะนำให้ใช้ an RTOS ที่จัดการ priority inversion อย่างถูกต้องและใช้ LWIP_TCPIP_CORE_LOCKING.
Porting: จัดให้มีใช้ทุกฟังชั่นใน Porting (system abstraction layer).
คุณสามารถใช้ "raw" APIs ร่วมกันกับ tcpip_callback, และทุก Sequential-style APIs.

tha


tha



เรียก a specific function ใน the thread context ของ tcpip_thread เพื่อเข้าถึง synchronization ได้ง่าย. A function ที่เรียกในวิธีนั้นอาจเข้าถึง lwIP core code โดยไม่มีการกลัวการเข้าถึงที่พร้อมกัน. บล็อกจนกระทั่ง the request ถูกโพสต์. ต้องไม่ถูกเรียกจาก interrupt context!

Parameters
            function   the function ที่เรียก
            ctx           parameter ที่ส่งผ่านไปยัง f

Returns
           ERR_OK ถ้า the function ถูกเรียกแล้ว, เป็น err_t อย่างอื่นถ้าไม่ใช่

See also
           tcpip_try_callback


tha


tha



จัดสรร a structure สำหรับ a static callback message และเริ่มต้นมัน. The message มี a special type ดังนั้น lwIP ไม่เคยปล่อยฟรีมัน. นี้ถูกมุ่งหมายเพื่อถูกใช้ส่ง "static" messages จาก interrupt context, ตัวอย่างเช่น the message ถูกจัดสรรครั้งเดียวและถูกโพสต์หลายครั้งจาก an IRQ โดยใช้ tcpip_callbackmsg_trycallback(). ตัวอย่างการใช้งาน: Trigger execution ของ an ethernet IRQ DPC routine ใน lwIP thread context.

Parameters
          function             the function ที่เรียก
          ctx                     parameter ที่ส่งผ่านไปยัง function

Returns
          a struct pointer ที่ส่งผ่านไปยัง tcpip_callbackmsg_trycallback().

See also
          tcpip_callbackmsg_trycallback()
          tcpip_callbackmsg_delete()

tha


tha



ลองโพสต์ a callback-message ไปยัง the tcpip_thread mbox. เหมือนกับ tcpip_callbackmsg_trycallback แต่เรียก sys_mbox_trypost_fromisr(), โดยหลักเพื่อช่วย FreeRTOS, ที่เรียกต่างที่กันระหว่าง task level และ ISR level.

Parameters
            msg   pointer ไปยัง the message เพื่อโพสต์

Returns
          sys_mbox_trypost_fromisr() return code (โดยไม่มีการเปลี่ยนแปลง, ดังนั้นความรู้นี้สามารถถูกใช้เพื่อตัวอย่างเช่น เผยแพร่
          "bool needs_scheduling")

See also
          tcpip_callbackmsg_new()

tha



เริ่มต้น module นี้:
       •   เริ่มต้น modules ย่อยทั้งหมด
       •   สตาร์ท the tcpip_thread

Parameters
          initfunc             a function ที่เรียกเมื่อ tcpip_thread กำลังรันและสำเร็จการเริ่มต้น
          arg                     argument ที่ส่งผ่านไปยัง initfunc