Skip to content

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

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

Merged
merged 4 commits into from
Apr 18, 2017
Merged

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

merged 4 commits into from
Apr 18, 2017

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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy