Archive for the ‘IOS Development’ Category
//// serviceSSDP.h// SimpleSSDPDiscovery//// Created by Ashu Joshi on 3/1/12.// Copyright (c) 2012 Movinture, LLC. All rights reserved.//
#import <Foundation/Foundation.h>#import “AsyncUdpSocket.h”#import “connectedLifeController.h”
@interface serviceSSDP : NSObject
// This is the string that is Multicast to Discover the Controller@property (strong, nonatomic) NSString *discoverControllerString;// The Controller would respond with the string below upon discovery being received@property (strong, nonatomic) NSString *responseStringFromController;// The list of discovered controllers@property (strong, nonatomic) NSMutableArray *controllerList;
@property (strong, nonatomic) connectedLifeController *currentController;@property (strong, nonatomic) AsyncUdpSocket *ssdpSocket;
– (BOOL)startControllerDiscoveryProcess;– (BOOL)startControllerDiscoveryProcess:(NSMutableArray *)listOfControllers;
I am going to provide more details on the project that I have in of the earlier posts. The objective of the project is to build a network interface between an iOS application & a device running OSGi (it could be any device running OSGi since that lends to portability but I am going to start with a Plug Computer). And using that network interface/protocol the IOS/iPad application would function as a “Remote Manager” to the Plug Computer. Obviously all code on the Plug that interacts with the iOS/iPad app would be developed in OSGi/JVM.
I had started doing some preliminary design work and thinking through in late January, and to prepare spent last two weeks of December (2011) getting my coding skills comfortable with both Java & iOS/Objective-C. The approach was to build the project incrementally, baby steps at a time. The key was to define the network protocol/interface between the iOS App & Plug. The interface by itself was very simple but I had to decide what it would do and more importantly in the first iteration what it won’t do.
Here is a simple diagram illustrating the protocol/interface, and I had decided to use a Sockets Interface between the iOS and Plug. The Plug and the iPad are both on the same network/subnet.
Using sockets was my first decision – in my next iteration I would move to a REST API between the two. I can comfortably say 3 months into it that the design & implementation is flexible enough where my “network interface” code on both sides is separate from the actual command processing. The next couple of decisions were also what not to take on in the first round of implementation – no TLS/SSL sockets and no authentication. I would take that on once I have the entire interface working. In addition there is no authentication or provisioning for the iPad/iOS app – that is – I have not built in any authorization check before the iOS/iPad app would be allowed to access the OSGi information on the Plug computers.
- I dusted up my C Programming skills first and then took up “Objective-C Programming: The Big Nerd Ranch Guide” by Aaron Hillegass. It had a very good refresher section C, and then went deep into Objective-C
- The second book I recommend is IOS Programming The Big Nerd Ranch Guide 2nd Edition by Jon Conway & Aaron Hillegass. This, of course, as the title suggests was more about IOS programming.
- The third but probably the most important resource was lectures at Stanford University by Paul Hagerty. And these are the best resource – if you are just starting out – I would recommend going with the Fall 2011-12 lectures.