1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

Merge remote-tracking branch 'arduino/master' into ide-1.5.x

This commit is contained in:
Federico Fissore 2015-02-27 11:09:16 +01:00
commit 4b224f82f0
14 changed files with 82 additions and 22 deletions

View File

@ -1187,6 +1187,7 @@ public class Base {
Action subAction = new AbstractAction(_(boardCustomMenu.get(customMenuOption))) {
public void actionPerformed(ActionEvent e) {
Preferences.set("custom_" + menuId, ((TargetBoard)getValue("board")).getId() + "_" + getValue("custom_menu_option"));
onBoardOrPortChange();
}
};
subAction.putValue("board", board);

View File

@ -26,6 +26,7 @@ import cc.arduino.packages.MonitorFactory;
import com.jcraft.jsch.JSchException;
import jssc.SerialPortException;
import processing.app.debug.*;
import processing.app.forms.PasswordAuthorizationDialog;
import processing.app.helpers.OSUtils;
@ -2572,6 +2573,12 @@ public class Editor extends JFrame implements RunnerListener {
statusError(_("Unable to connect: is the sketch using the bridge?"));
} catch (JSchException e) {
statusError(_("Unable to connect: wrong password?"));
} catch (SerialException e) {
String errorMessage = e.getMessage();
if (e.getCause() != null && e.getCause() instanceof SerialPortException) {
errorMessage += " (" + ((SerialPortException) e.getCause()).getExceptionType() + ")";
}
statusError(errorMessage);
} catch (Exception e) {
statusError(e);
} finally {

View File

@ -58,19 +58,32 @@ public class NetworkDiscovery implements Discovery, ServiceListener, cc.arduino.
@Override
public List<BoardPort> discovery() {
List<BoardPort> ports = clonePortsList();
Iterator<BoardPort> iterator = ports.iterator();
while (iterator.hasNext()) {
List<BoardPort> boardPorts = clonePortsList();
Iterator<BoardPort> boardPortIterator = boardPorts.iterator();
while (boardPortIterator.hasNext()) {
try {
BoardPort board = iterator.next();
if (!NetUtils.isReachable(InetAddress.getByName(board.getAddress()), Integer.parseInt(board.getPrefs().get("port")))) {
iterator.remove();
BoardPort board = boardPortIterator.next();
InetAddress inetAddress = InetAddress.getByName(board.getAddress());
int broadcastedPort = Integer.valueOf(board.getPrefs().get("port"));
List<Integer> ports = new LinkedList<Integer>();
ports.add(broadcastedPort);
//dirty code: allows non up to date yuns to be discovered. Newer yuns will broadcast port 22
if (broadcastedPort == 80) {
ports.add(0, 22);
}
boolean reachable = NetUtils.isReachable(inetAddress, ports);
if (!reachable) {
boardPortIterator.remove();
}
} catch (UnknownHostException e) {
iterator.remove();
boardPortIterator.remove();
}
}
return ports;
return boardPorts;
}
private List<BoardPort> clonePortsList() {

View File

@ -37,9 +37,9 @@ import processing.app.packages.LibraryList;
public class BaseNoGui {
/** Version string to be used for build */
public static final int REVISION = 10600;
public static final int REVISION = 10601;
/** Extended version string displayed on GUI */
static String VERSION_NAME = "1.6.0";
static String VERSION_NAME = "1.6.1";
static File buildFolder;

View File

@ -4,14 +4,41 @@ import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.Arrays;
import java.util.List;
public abstract class NetUtils {
private static boolean isReachableByEcho(InetAddress address) {
try {
return address.isReachable(100);
} catch (IOException e) {
return false;
}
}
public static boolean isReachable(InetAddress address, int port) {
return isReachable(address, Arrays.asList(port));
}
public static boolean isReachable(InetAddress address, List<Integer> ports) {
if (isReachableByEcho(address)) {
return true;
}
boolean reachable = false;
for (Integer port : ports) {
reachable = reachable || isPortOpen(address, port);
}
return reachable;
}
private static boolean isPortOpen(InetAddress address, int port) {
Socket socket = null;
try {
socket = new Socket();
socket.connect(new InetSocketAddress(address, port), 100);
socket.connect(new InetSocketAddress(address, port), 300);
return true;
} catch (IOException e) {
return false;

View File

@ -1,4 +1,14 @@
ARDUINO 1.6.1
[ide]
* Improved Yun detection for upload via network (Ron Guest)
* In platforms.txt "objcopy" recipe is no more tied to the "hex" format (Arnav Gupta)
* /dev/cu.* serial ports are now filtered from the port list on MacOSX
* Ports in ports list are now grouped by type
* Upgraded avr-gcc toolchains to 3.4.5
* Fixed wrong parsing of boards.txt when using submenu and boards id with underscores
ARDUINO 1.6.0 - 2015.02.09
[ide]

View File

@ -6,7 +6,7 @@
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
name=Arduino AVR Boards
version=1.6.0
version=1.6.1
# AVR compile variables
# ---------------------

View File

@ -5,7 +5,7 @@
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
name=Arduino ARM (32-bits) Boards
version=1.6.0
version=1.6.1
# SAM3 compile variables
# ----------------------

View File

@ -26,8 +26,8 @@
#include <YunServer.h>
#include <YunClient.h>
// Listen on default port 5555, the webserver on the Yún
// will forward there all the HTTP requests for us.
// Listen to the default port 5555, the Yún webserver
// will forward there all the HTTP requests you send
YunServer server;
void setup() {

View File

@ -24,6 +24,8 @@ public:
virtual void stop();
virtual uint8_t connected();
virtual operator bool();
virtual bool operator==(const bool value) { return bool() == value; }
virtual bool operator!=(const bool value) { return bool() != value; }
virtual bool operator==(const EthernetClient&);
virtual bool operator!=(const EthernetClient& rhs) { return !this->operator==(rhs); };

View File

@ -1,6 +1,6 @@
name=LiquidCrystal
version=1.0
author=
author=Arduino, Adafruit
maintainer=Arduino <info@arduino.cc>
sentence=Allows communication with alphanumerical liquid crystal displays (LCDs). For all Arduino boards.
paragraph=This library allows an Arduino board to control LiquidCrystal displays (LCDs) based on the Hitachi HD44780 (or a compatible) chipset, which is found on most text-based LCDs. The library works with in either 4 or 8 bit mode (i.e. using 4 or 8 data lines in addition to the rs, enable, and, optionally, the rw control lines).

View File

@ -1,7 +1,7 @@
name=SD
version=1.0
author=
maintainer=
author=Arduino, SparkFun
maintainer=Arduino <info@arduino.cc>
sentence=Enables reading and writing on SD cards. For all Arduino boards.
paragraph=Once an SD memory card is connected to the SPI interfare of the Arduino board you are enabled to create files and read/write on them. You can also move through directories on the SD card.
category=Data Storage

View File

@ -1,7 +1,7 @@
name=Stepper
version=1.0
author=
maintainer=
author=Arduino
maintainer=Arduino <info@arduino.cc>
sentence=Allows Arduino boards to control a variety of stepper motors. For all Arduino boards.
paragraph=This library allows you to control unipolar or bipolar stepper motors. To use it you will need a stepper motor, and the appropriate hardware to control it.
category=Device Control

View File

@ -1,7 +1,7 @@
name=TFT
version=1.0
author=
maintainer=
author=Arduino, Adafruit
maintainer=Arduino <info@arduino.cc>
sentence=Allows drawing text, images, and shapes on the Arduino TFT graphical display. For all Arduino boards.
paragraph=This library is compatible with most of the TFT display based on the ST7735 chipset
category=Display