Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

added reference for values in MCP4728.py and fixed some warnings#51

Merged
mariobehling merged 4 commits intofossasia:developmentfossasia/pslab-python:developmentfrom
viveksb007:developmentCopy head branch name to clipboard
Apr 18, 2017
Merged

added reference for values in MCP4728.py and fixed some warnings#51
mariobehling merged 4 commits intofossasia:developmentfossasia/pslab-python:developmentfrom
viveksb007:developmentCopy head branch name to clipboard

Conversation

@viveksb007
Copy link
Member

Fixes #50
added reference for values dictionary in MCP4728.py and fixed some warnings.

@jithinbp
Copy link
Collaborator

jithinbp commented Apr 18, 2017

@viveksb007 Could you please make a slight edit to the connectToPort method in packet_handler.py?
The current method will cause it to fail on Windows and OSX, and prevent execution of the entire application.
The socket creation attempt is Unix specific, and should only be called if the platform is Unix. Its purpose is to prevent multiple applications from accessing the serial port simultaneously, and causing clashes. Appropriate socket types must be defined for OSX, Windows .

def connectToPort(self, portname):
	if platform.system() not in ["Windows","Darwin"]:   #Do this check only on Unix
		try:
			import socket
			self.blockingSocket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
			self.blockingSocket.bind('\0eyesj2%s'%portname) 
			self.blockingSocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
		except socket.error as e:
			self.occupiedPorts.add(portname)
			raise RuntimeError("Another program is using %s (%d)" % (portname) )
	...

Thanks

@jithinbp
Copy link
Collaborator

Thanks!

@mariobehling mariobehling merged commit 2cddcf2 into fossasia:development Apr 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add reference of values in MCP4728.py

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.