mirror of
https://github.com/xushoucai/RTL8710_SDK_GCC_VERSION.git
synced 2026-07-02 01:25:42 +00:00
GCC SDK RTL8710 basic version (including the window platform cygwin installation and Ubuntu platform Linux Installation routines),
including cross compilation of the installation, compile, link, run, debug, and so on. SDK implementation of the function: 1, WiFi connection settings (including AP mode and STA mode). 2, peripheral resource control (including GPIO, SPI, UART, IIC, etc.). 3, the user uses the sample method.
This commit is contained in:
parent
36b1b0dcd9
commit
905d81784e
2094 changed files with 779991 additions and 0 deletions
26
component/common/network/mDNS/mDNS.h
Normal file
26
component/common/network/mDNS/mDNS.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef _MDNS_H
|
||||
#define _MDNS_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* Text Record */
|
||||
typedef struct _TXTRecordRef_t {
|
||||
char PrivateData[16];
|
||||
} TXTRecordRef;
|
||||
|
||||
extern void TXTRecordCreate(TXTRecordRef *txtRecord, uint16_t bufferLen, void *buffer);
|
||||
extern int TXTRecordSetValue(TXTRecordRef *txtRecord, const char *key, uint8_t valueSize, const void *value);
|
||||
extern void TXTRecordDeallocate(TXTRecordRef *txtRecord);
|
||||
|
||||
/* mDNS */
|
||||
typedef void *DNSServiceRef;
|
||||
|
||||
extern int mDNSResponderInit(void);
|
||||
extern void mDNSResponderDeinit(void);
|
||||
extern DNSServiceRef mDNSRegisterService(char *name, char *service_type, char *domain, unsigned short port, TXTRecordRef *txtRecord);
|
||||
extern void mDNSDeregisterService(DNSServiceRef serviceRef);
|
||||
extern void mDNSUpdateService(DNSServiceRef serviceRef, TXTRecordRef *txtRecord, unsigned int ttl);
|
||||
extern void mDNSRegisterAllInterfaces(void);
|
||||
extern void mDNSDeregisterAllInterfaces(void);
|
||||
|
||||
#endif /* _MDNS_H */
|
||||
37
component/common/network/mDNS/mDNSPlatform.c
Normal file
37
component/common/network/mDNS/mDNSPlatform.c
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#include <lwip/sockets.h>
|
||||
#include <lwip/netif.h>
|
||||
extern struct netif xnetif[];
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Mandatory functions
|
||||
*-----------------------------------------------------------------------*/
|
||||
|
||||
// Mandatory function for custom initialization
|
||||
// called when mDNS initialization
|
||||
void mDNSPlatformCustomInit(void)
|
||||
{
|
||||
xnetif[0].flags |= NETIF_FLAG_IGMP;
|
||||
}
|
||||
|
||||
uint16_t mDNSPlatformHtons(uint16_t hostshort)
|
||||
{
|
||||
return htons(hostshort);
|
||||
}
|
||||
|
||||
uint32_t mDNSPlatformInetAddr(char *cp)
|
||||
{
|
||||
return inet_addr(cp);
|
||||
}
|
||||
|
||||
// Mandatory function to get hostname
|
||||
// called when mDNS initialization
|
||||
char *mDNSPlatformHostname(void)
|
||||
{
|
||||
#if LWIP_NETIF_HOSTNAME
|
||||
return xnetif[0].hostname;
|
||||
#else
|
||||
return "ameba";
|
||||
#endif
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue