UDP
이 모듈에는 UDP 통신을 제어하는 기능이 포함되어 있습니다.
요약
        열거 | 
    |
|---|---|
        otNetifIdentifier{
       | 
      enum OpenThread 네트워크 인터페이스 식별자를 정의합니다.   | 
    
        Typedef | 
    |
|---|---|
        otNetifIdentifier
       | 
      typedefenum otNetifIdentifier
        OpenThread 네트워크 인터페이스 식별자를 정의합니다.   | 
    
        otUdpHandler)(void *aContext, const otMessage *aMessage, const otMessageInfo *aMessageInfo)
       | 
      typedefbool(*
        이 콜백을 통해 OpenThread는 특정 UDP 메시지에 대한 특정 핸들러를 제공할 수 있습니다.   | 
    
        otUdpReceive)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
       | 
      typedefvoid(*
        이 콜백을 통해 OpenThread가 수신된 UDP 메시지를 애플리케이션에 알릴 수 있습니다.   | 
    
        otUdpReceiver
       | 
      typedefstruct otUdpReceiver
        UDP 수신기를 나타냅니다.   | 
    
        otUdpSocket
       | 
      typedefstruct otUdpSocket
        UDP 소켓을 나타냅니다.   | 
    
        함수 | 
    |
|---|---|
        otUdpAddReceiver(otInstance *aInstance, otUdpReceiver *aUdpReceiver)
       | 
      
        
         UDP 수신기를 추가합니다.  
       | 
    
        otUdpBind(otInstance *aInstance, otUdpSocket *aSocket, const otSockAddr *aSockName, otNetifIdentifier aNetif)
       | 
      
        
         UDP/IPv6 소켓을 바인딩합니다.  
       | 
    
        otUdpClose(otInstance *aInstance, otUdpSocket *aSocket)
       | 
      
        
         UDP/IPv6 소켓을 닫습니다.  
       | 
    
        otUdpConnect(otInstance *aInstance, otUdpSocket *aSocket, const otSockAddr *aSockName)
       | 
      
        
         UDP/IPv6 소켓을 연결합니다.  
       | 
    
        otUdpGetSockets(otInstance *aInstance)
       | 
      
        
         UDP 소켓의 연결된 목록의 헤드를 가져옵니다.  
       | 
    
        otUdpIsOpen(otInstance *aInstance, const otUdpSocket *aSocket)
       | 
      
        bool
        UDP 소켓이 열려 있는지 확인합니다.  
       | 
    
        otUdpNewMessage(otInstance *aInstance, const otMessageSettings *aSettings)
       | 
      
        
         UDP 메시지를 전송하기 위한 새 메시지 버퍼를 할당합니다.  
       | 
    
        otUdpOpen(otInstance *aInstance, otUdpSocket *aSocket, otUdpReceive aCallback, void *aContext)
       | 
      
        
         UDP/IPv6 소켓을 엽니다.  
       | 
    
        otUdpRemoveReceiver(otInstance *aInstance, otUdpReceiver *aUdpReceiver)
       | 
      
        
         UDP 수신기를 삭제합니다.  
       | 
    
        otUdpSend(otInstance *aInstance, otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo *aMessageInfo)
       | 
      
        
         UDP/IPv6 메시지를 전송합니다.  
       | 
    
        otUdpSendDatagram(otInstance *aInstance, otMessage *aMessage, otMessageInfo *aMessageInfo)
       | 
      
        
         소켓 없이 UDP 메시지를 전송합니다.  
       | 
    
        구조체 | 
    |
|---|---|
| otUdpReceiver | 
         UDP 수신기를 나타냅니다.  | 
    
| otUdpSocket | 
         UDP 소켓을 나타냅니다.  | 
    
열거형
otNetifIdentifier
otNetifIdentifier
OpenThread 네트워크 인터페이스 식별자를 정의합니다.
| 속성 | |
|---|---|
            OT_NETIF_BACKBONE
           | 
          
             백본 인터페이스  | 
        
            OT_NETIF_THREAD
           | 
          
             Thread 인터페이스입니다.  | 
        
            OT_NETIF_UNSPECIFIED
           | 
          
             지정되지 않은 네트워크 인터페이스입니다.  | 
        
Typedef
otUdpHandler
bool(* otUdpHandler)(void *aContext, const otMessage *aMessage, const otMessageInfo *aMessageInfo)
이 콜백을 통해 OpenThread는 특정 UDP 메시지에 대한 특정 핸들러를 제공할 수 있습니다.
| 세부정보 | |||||
|---|---|---|---|---|---|
| 반환 값 | 
              
  | 
          ||||
otUdpReceive
void(* otUdpReceive)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
이 콜백을 통해 OpenThread가 수신된 UDP 메시지를 애플리케이션에 알릴 수 있습니다.
함수
otUdpAddReceiver
otError otUdpAddReceiver( otInstance *aInstance, otUdpReceiver *aUdpReceiver )
UDP 수신기를 추가합니다.
| 세부정보 | |||||
|---|---|---|---|---|---|
| 매개변수 | 
              
  | 
          ||||
| 반환 값 | 
              
  | 
          ||||
otUdpBind
otError otUdpBind( otInstance *aInstance, otUdpSocket *aSocket, const otSockAddr *aSockName, otNetifIdentifier aNetif )
UDP/IPv6 소켓을 바인딩합니다.
| 세부정보 | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| 매개변수 | 
              
  | 
          ||||||||
| 반환 값 | 
              
  | 
          ||||||||
otUdpClose
otError otUdpClose( otInstance *aInstance, otUdpSocket *aSocket )
UDP/IPv6 소켓을 닫습니다.
| 세부정보 | |||||
|---|---|---|---|---|---|
| 매개변수 | 
              
  | 
          ||||
| 반환 값 | 
              
  | 
          ||||
otUdpConnect
otError otUdpConnect( otInstance *aInstance, otUdpSocket *aSocket, const otSockAddr *aSockName )
UDP/IPv6 소켓을 연결합니다.
| 세부정보 | |||||||
|---|---|---|---|---|---|---|---|
| 매개변수 | 
              
  | 
          ||||||
| 반환 값 | 
              
  | 
          ||||||
otUdpGetSockets
otUdpSocket * otUdpGetSockets( otInstance *aInstance )
UDP 소켓의 연결된 목록의 헤드를 가져옵니다.
| 세부정보 | |||
|---|---|---|---|
| 매개변수 | 
              
  | 
          ||
| 반환 | 
               UDP 소켓 연결 목록의 헤드에 대한 포인터입니다.  
             | 
          ||
otUdpIsOpen
bool otUdpIsOpen( otInstance *aInstance, const otUdpSocket *aSocket )
UDP 소켓이 열려 있는지 확인합니다.
| 세부정보 | |||||
|---|---|---|---|---|---|
| 매개변수 | 
              
  | 
          ||||
| 반환 | 
               UDP 소켓이 열려 있는지 여부입니다.  
             | 
          ||||
otUdpNewMessage
otMessage * otUdpNewMessage( otInstance *aInstance, const otMessageSettings *aSettings )
UDP 메시지를 전송하기 위한 새 메시지 버퍼를 할당합니다.
| 세부정보 | |||||
|---|---|---|---|---|---|
| 매개변수 | 
              
  | 
          ||||
| 반환 | 
               메시지 버퍼에 대한 포인터 또는 사용할 수 있는 메시지 버퍼가 없거나 매개변수가 유효하지 않은 경우 NULL입니다. 
             | 
          ||||
otMessageFree
otUdpOpen
otError otUdpOpen( otInstance *aInstance, otUdpSocket *aSocket, otUdpReceive aCallback, void *aContext )
UDP/IPv6 소켓을 엽니다.
| 세부정보 | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| 매개변수 | 
              
  | 
          ||||||||
| 반환 값 | 
              
  | 
          ||||||||
otUdpRemoveReceiver
otError otUdpRemoveReceiver( otInstance *aInstance, otUdpReceiver *aUdpReceiver )
UDP 수신기를 삭제합니다.
| 세부정보 | |||||
|---|---|---|---|---|---|
| 매개변수 | 
              
  | 
          ||||
| 반환 값 | 
              
  | 
          ||||
otUdpSend
otError otUdpSend( otInstance *aInstance, otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo *aMessageInfo )
UDP/IPv6 메시지를 전송합니다.
반환 값이 OT_ERROR_NONE이면 OpenThread가 aMessage의 소유권을 가져오므로 호출자는 더 이상 aMessage를 참조해서는 안 됩니다. 반환 값이 OT_ERROR_NONE이 아니면 호출자는 메시지 버퍼가 더 이상 필요하지 않은 경우 aMessage를 해제하는 등 aMessage의 소유권을 유지합니다.
| 세부정보 | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| 매개변수 | 
              
  | 
          ||||||||
| 세부정보 | |||||||
|---|---|---|---|---|---|---|---|
| 반환 값 | 
              
  | 
          ||||||
otUdpSendDatagram
otError otUdpSendDatagram( otInstance *aInstance, otMessage *aMessage, otMessageInfo *aMessageInfo )
소켓 없이 UDP 메시지를 전송합니다.
| 세부정보 | |||||||
|---|---|---|---|---|---|---|---|
| 매개변수 | 
              
  | 
          ||||||
| 반환 값 | 
              
  | 
          ||||||
자료
OpenThread API 참조 주제는 GitHub에서 제공되는 소스 코드에서 비롯됩니다. 자세한 내용을 알아보거나 문서에 참여하려면 리소스를 참고하세요.