-
Notifications
You must be signed in to change notification settings - Fork 48
STM32Ethernet source files #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok - may be good to have some information inside the README.md as well.
README.md
Outdated
## Ethernet Library for Arduino | ||
|
||
With an STM32 board with Ethernet compatibility, this library allows an STM32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo: an STM32
README.md
Outdated
The library is based on LwIP, a Lightweight TCP/IP stack. | ||
http://git.savannah.gnu.org/cgit/lwip.git | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mention that LWIP has been ported as Arduino lib and this lib is dependent of this one
by Norbert Truchsess | ||
modified 23 Jun 2017 | ||
by Wi6Labs | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add dependency with LWIP lib from stm32duino (far all example)
library.properties
Outdated
author=Various | ||
maintainer=STMicroelectronics | ||
sentence=Enables network connection (local and Internet) using the STM32 Board. | ||
paragraph=With this library you can use the STM32 board to connect to Internet. The library provides both Client and server functionalities. The library permits you to connect to a local network also with DHCP and to resolve DNS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mention LWIP stm23duino dependency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please; enable all compilers warning to ensure there is no one (at least for this lib)
src/Dns.cpp
Outdated
uint16_t acc = 0; // Accumulator | ||
uint8_t dots = 0; | ||
|
||
while (*address) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check if address is NULL
src/Dhcp.h
Outdated
/* DHCP state machine. */ | ||
#define STATE_DHCP_STOP DHCP_OFF | ||
#define STATE_DHCP_START DHCP_START | ||
#define STATE_DHCP_DISCOVER DHCP_WAIT_ADDRESS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace tab by space
src/Dhcp.h
Outdated
private: | ||
uint8_t _dhcpMacAddr[6]; | ||
unsigned long _timeout; | ||
uint8_t _dhcp_lease_state; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace tab by space
src/Dns.cpp
Outdated
|
||
#include "Dns.h" | ||
#include <string.h> | ||
//#include <stdlib.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comment
src/Dns.cpp
Outdated
{ | ||
UNUSED(aName); | ||
// Success! Everything buffered okay | ||
return 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please explain why always return 1 (deprecated?)
src/EthernetClient.cpp
Outdated
} | ||
|
||
_tcp_client->pcb = NULL; | ||
// _tcp_client->state = TCP_NONE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to remove
src/STM32Ethernet.cpp
Outdated
int EthernetClass::maintain(){ | ||
int rc = DHCP_CHECK_NONE; | ||
|
||
// stm32_eth_scheduler(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove or add more comment
src/utility/ethernetif.c
Outdated
****************************************************************************** | ||
*/ | ||
/* Includes ------------------------------------------------------------------*/ | ||
#include "stm32f4xx_hal.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use generic include stm32_def.h
src/utility/stm32_eth.c
Outdated
/* Configure the Network interface */ | ||
Netif_Config(); | ||
|
||
//TODO: juste temporaire pour debug: laisser à l'utilisateur la possibilité de l'utiliser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In English and explain more please
src/utility/stm32_eth.c
Outdated
pbuf_free(p); | ||
p = q; | ||
return p; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty else ? to remove
Signed-off-by: fpr <[email protected]>
Signed-off-by: fpr <[email protected]>
Signed-off-by: fpr <[email protected]>
Add Ethernet interface for Arduino class. Signed-off-by: fpr <[email protected]>
…uino Ethernet library Signed-off-by: fpr <[email protected]>
Signed-off-by: fpr <[email protected]>
Signed-off-by: fpr <[email protected]>
Signed-off-by: fpr <[email protected]>
Signed-off-by: fpr <[email protected]>
|
Signed-off-by: fpr <[email protected]>
Thank you @danieleff . |
src/Dhcp.h
Outdated
#define DEFAULT_LEASE (900) //default lease time in seconds | ||
#define STATE_DHCP_STOP DHCP_OFF | ||
#define STATE_DHCP_START DHCP_START | ||
#define STATE_DHCP_DISCOVER DHCP_WAIT_ADDRESS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix indent
// Enter a MAC address for your controller below. | ||
// Newer Ethernet shields have a MAC address printed on a sticker on the shield | ||
byte mac[] = { | ||
0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace by
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
#include <STM32Ethernet.h> | ||
|
||
// Enter a MAC address for your controller below. | ||
// Newer Ethernet shields have a MAC address printed on a sticker on the shield |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this line
// The IP address will be dependent on your local network. | ||
// gateway and subnet are optional: | ||
byte mac[] = { | ||
0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
#include <EthernetUdp.h> | ||
|
||
// Enter a MAC address for your controller below. | ||
// Newer Ethernet shields have a MAC address printed on a sticker on the shield |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this line
examples/WebClient/WebClient.ino
Outdated
#include <STM32Ethernet.h> | ||
|
||
// Enter a MAC address for your controller below. | ||
// Newer Ethernet shields have a MAC address printed on a sticker on the shield |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this line
…CP_fails when DHCP fails the static IP can be appllied without problem
STM32Ethernet source files for Ethernet library for STM32 cores and Arduino environment.