All Projects → jensmeder → Darklightning

jensmeder / Darklightning

Licence: mit
Simply the fastest way to transmit data between iOS/tvOS and OSX

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Darklightning

Extendable
Blocks Based Bluetooth LE Connectivity framework for iOS/watchOS/tvOS/OSX. Quickly configure centrals & peripherals, perform read/write operations, and respond characteristic updates.
Stars: ✭ 88 (-69.23%)
Mutual labels:  osx, tvos
Fire
🔥A delightful HTTP/HTTPS networking framework for iOS/macOS/watchOS/tvOS platforms written in Swift.
Stars: ✭ 243 (-15.03%)
Mutual labels:  osx, tvos
Kvconstraintkit
An Impressive Auto Layout DSL for iOS, tvOS & OSX. & It is written in pure swift.
Stars: ✭ 91 (-68.18%)
Mutual labels:  osx, tvos
Xcake
🍰 Describe Xcode projects in a human readable format and (re)generate one on demand.
Stars: ✭ 549 (+91.96%)
Mutual labels:  osx, tvos
Usbdeviceswift
wrapper for IOKit.usb and IOKit.hid written on pure Swift that allows you convenient work with USB devices
Stars: ✭ 156 (-45.45%)
Mutual labels:  usb, osx
Nord Xcode
An arctic, north-bluish clean and elegant Xcode color theme.
Stars: ✭ 63 (-77.97%)
Mutual labels:  osx, tvos
Metal Tutorial
Metal入门资料,涉及到iOS平台,OSX平台,TvOS平台,其中,OSX平台可以直接运行,iOS平台,TvOS平台都需要使用真机设备测试运行。下面是相关博客,欢迎拍砖
Stars: ✭ 156 (-45.45%)
Mutual labels:  osx, tvos
Sqlitelib
Easily build a custom SQLite static library for use in macOS and iOS frameworks and apps.
Stars: ✭ 38 (-86.71%)
Mutual labels:  osx, tvos
Ehal
Embedded Hardware Abstraction Library
Stars: ✭ 84 (-70.63%)
Mutual labels:  usb, osx
Headsetcontrol
Sidetone and Battery status for Logitech G930, G533, G633, G933 SteelSeries Arctis 7/PRO 2019 and Corsair VOID (Pro) in Linux and MacOSX
Stars: ✭ 392 (+37.06%)
Mutual labels:  usb, osx
Layoutframeworkbenchmark
Benchmark the performances of various Swift layout frameworks (autolayout, UIStackView, PinLayout, LayoutKit, FlexLayout, Yoga, ...)
Stars: ✭ 316 (+10.49%)
Mutual labels:  osx, tvos
Swift-IOS-ANE
FlashRuntimeExtensions.swift. Example Air Native Extension written in Swift 5 for iOS, macOS and tvOS
Stars: ✭ 56 (-80.42%)
Mutual labels:  osx, tvos
Swiftfortunewheel
The ultimate spinning wheel view that supports dynamic content and rich customization.
Stars: ✭ 114 (-60.14%)
Mutual labels:  osx, tvos
Vmware Usb Osx
Easily create a bootable USB installer for VMware ESXi / vSphere Hypervisor
Stars: ✭ 286 (+0%)
Mutual labels:  usb, osx
Jsonify
♨️A delightful JSON parsing framework.
Stars: ✭ 42 (-85.31%)
Mutual labels:  osx, tvos
mkosxinstallusb
Linux shell script that creates USB flash drive booting OS X installer
Stars: ✭ 34 (-88.11%)
Mutual labels:  usb, osx
Xestimonitors
An extensible monitoring framework written in Swift
Stars: ✭ 269 (-5.94%)
Mutual labels:  tvos
Audioindicatorbars
AIB indicates for your app users which audio is playing. Just like the Podcasts app.
Stars: ✭ 279 (-2.45%)
Mutual labels:  tvos
Imessage
💬 Send iMessages from command-line
Stars: ✭ 261 (-8.74%)
Mutual labels:  osx
12306formac
An unofficial 12306 Client for Mac
Stars: ✭ 2,796 (+877.62%)
Mutual labels:  osx

Build Status CocoaPods Compatible Carthage Compatible codecov.io codebeat badge

DarkLightning

DarkLightning is a lightweight Swift library to allow data transmission between iOS/tvOS devices (Lightning port, Dock connector, USB-C) and OSX (USB) at 480MBit - without jailbreaking your iOS/tvOS device. It uses the usbmuxd service on OSX to open a TCP socket connection to the iOS/tvOS device.

Overview

  1. Features
  2. System requirements
  3. Installation
  4. Usage
  5. Example
  6. License

1. Features

  • iOS/tvOS und OSX implementations to transmit data with up to 480 MBit via USB between iOS/tvOS and OSX
  • Simulator connection for debugging with iOS/tvOS Simulator
  • Information on connected iOS/tvOS devices on OSX
  • Callbacks for newly connected and disconnected iOS/tvOS devices on OSX

2. Requirements

  • iOS 8.0+
  • tvOS 9.0+
  • Mac OS X 10.10+
  • Xcode 8.3

3. Installation

DarkLightning is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "DarkLightning"

There are three subspecs included: iOS, tvOS and OSX. CocoaPods automatically selects the correct subspec depending on the platform you are developing for. That means that pod "DarkLightning" and pod "DarkLightning/iOS" have the same effect if you are developing an iOS app.

4. Usage

The basic procedure to open a connection between iOS/tvOS and OSX looks like this:

  1. Start a DevicePort on a port on iOS/tvOS
  2. Discover the device on OSX
  3. Establish a connection to the previously defined port on iOS/tvOS

You can send an arbitrary amount of bytes between iOS/tvOS and OSX. The data are being sent using TCP.

4.1 iOS/tvOS

4.1.1 Initialization

let port = DevicePort(delegate: MyPortDelegate())
port.open()

4.1.2 Receiving Data

public func port(port: DarkLightning.Port, didReceiveData data: OOData) {

}

4.1.3 Sending Data

let data = "Hello World".data(using: .utf8)
port.writeData(data: data!)

4.2 OSX

4.2.1 Initialization

let daemon = USBDaemon(delegate: MyDaemonDelegate(), deviceDelegate: MyDeviceDelegate())
daemon.start()

4.2.2 Device Discovery

As soon as you plug in or out an iOS/tvOS device to your Mac you will receive a callback on the corresponding delegate method (daemon(_:didAttach:) or daemon(_:didDetach:)) of USBDaemon. You will also receive a callback on daemon(_:didAttach:) for every iOS/tvOS device that was already attached to OSX when you started the discovery via daemon.start().

// Called for every device that already is or will be attached to the system

public func daemon(_ daemon: Daemon, didAttach device: Device) {
     
}

// Called for every iOS/tvOS device that has been detached from the system

public func daemon(_ daemon: Daemon, didDetach device: Device) {
        
}

4.2.3 Connections

With the help of a discovered Device you can now establish a connection to your iOS/tvOS app.

device.connect()

When you are done with the connection make sure to close it properly.

device.disconnect()

4.2.4 Receiving Data

public func device(_ device: Device, didReceiveData data: OOData) {
		
}

4.2.3 Sending Data

let data = "Hello World".data(using: .utf8)
device.writeData(data: data!)

5. Example

The Example (see Example folder) is a simple messenger that uses DarkLightning to send text messages from iOS/tvOS to OSX and vice versa.

Note: The iOS/tvOS application needs to be launched before the OSX part. The OSX part will try to connect to the first device that has been attached via USB. If there are no attached devices it tries to connect to the iOS/tvOS Simulator.

6. License

The MIT License (MIT)

Copyright (c) 2017 Jens Meder

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].