This repository has been archived by the owner on Jul 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
71 lines (46 loc) · 2.12 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
** AS OF JULY 2021 THIS REPOSITORY HAS BEEN SET TO ARCHIVE MODE AS THE LIBRARY IS NOT CURRENTLY MAINTAINED **
python-irda : IrDA Socket Interface for Python
----------------------------------------------
Author: Jonathan Krauss
E-Mail: [email protected]
This module implements a lightweight IrDA socket interface for Python. It is modeled after and uses a similar interface to the default Python 'socket' module. The code has been tested on Linux and Windows 7 64bit.
The code is released under a BSD license.
Basic Usage
-----------
import irda
# Enumerate IrDA Devices
devs = irda.discover()
# Create a new IrDA Socket
sck = irda.irsocket()
# Connect to the first device
sck.set_timeout(2000)
sck.connect(devs[0]['addr'])
# Read and write using send(data) and recv(num_bytes)
sck.send('\x14')
sdat = sck.recv(4)
data = unpack('<L', sdat)[0]
# Close socket when done
sck.close()
Building/Installation
---------------------
Run the following commands (or equivalents) to build and install irsocket:
$ python setup.py build
$ sudo python setup.py install
Building on Windows 10
======================
Timmy from Sweden has provided the following build instructions for Windows 10:
OS: Windows 10
Python version: 2.7.18, x86.
- Enable "IrDA IR" in Windows 10 under "Apps and functions" > "Optional features".
- Run Visual C++ Build Tools (vs_buildtools__819586963.1626546045.exe).
Tick "Desktop development with C++" in the left section.
If you only want the absolutely necessary tools for the purpose of building the IrDA module, tick only "MSVC v142 - VS 2019 C++ x64/x86 build tools (Latest)" and "Windows 10 SDK (10.0.19041.0)" in the right section.
- Edit the file "c:\(Python 2.7)\Lib\distutils\msvc9compiler.py"
Make the function find_vcvarsall() immediately return "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsall.bat"
- Make sure that you build/install the module under Python 2 if you have multiple versions on your system.
py -2 setup.py build
and
py -2 setup.py install
Bugs/Additions
--------------
Please feel free to send pull requests or patches to <[email protected]>