Contents
go-net-upnp
go-net-upnp is a new open source framework for Go and UPnP™ developers.
UPnP™ is a standard protocol for IoT, the protocols consist of other standard protocols, such as GENA, SSDP, SOAP, HTTPU and HTTP. Therefore you have to understand and implement these protocols to create UPnP™ applications.
go-net-upnp hansles these protocols automatically to support to create UPnP devices and control points quickly.
Installation
The project is released on GitHub. To use go-net-upnp in your projct, run go get
as the following:
go get -u github.com/cybergarage/go-net-upnp/net/upnp
Overview
go-net-upnp provides UPnP control point and device frameworks to implement the control point and any devices.
Control Point Implementation
go-net-upnp supports UPnP control functions. The control point can search UPnP devices in the local netowrk, get the device and service descriptions. and post actions in the service:
import (
"github.com/cybergarage/go-net-upnp/net/upnp"
)
cp := upnp.NewControlPoint()
err := cp.Start()
...
defer cp.Stop()
...
err = cp.SearchRootDevice()
...
for n, dev := range cp.GetRootDevices() {
...
}
The control point can post actions in the service, and get the action response:
service, err := dev.GetServiceByType("xxxx")
...
action, err := service.GetActionByName("xxxx")
...
action.SetArgumentString("xxxx", "xxxx")
err = action.Post()
...
resArg = action.GetArgumentString("xxxx")
Device Implementation
In addition to the control point functions, go-net-upnp supports UPnP device functions to implement any UPnP devices using Go.
To implement UPnP devices, prepare the UPnP device and service descriptions as the following:
import (
"github.com/cybergarage/go-net-upnp/net/upnp"
)
type SampleDevice struct {
*upnp.Device
...
}
func NewSampleDevice() (*SampleDevice, error) {
dev, err := upnp.NewDeviceFromDescription(xxxxDeviceDescription)
...
service, err := dev.GetServiceByType("urn:schemas-upnp-org:service:xxxx:x")
...
err = service.LoadDescriptionBytes([]byte(xxxxServiceDescription))
...
sampleDev := &SampleDevice{
Device: dev,
...
}
return sampleDev, nil
}
Next, implement the control actions in the service descriptions using upnp.ActionListener as the following:
sampleDev, err := NewSampleDevice()
...
sampleDev.ActionListener = sampleDev
...
func (self *SampleDevice) ActionRequestReceived(action *upnp.Action) upnp.Error {
switch action.Name {
case SetTarget:
xxxx, err := action.GetArgumentString(xxxx)
...
err := action.SetArgumentBool(...., ....)
...
return nil
case xxxx
...
}
return upnp.NewErrorFromCode(upnp.ErrorOptionalActionNotImplemented)
}
Next Steps
To know how to implement UPnP control point or devices in more deital using go-net-upnp, please check the sample implementations in the example
directory and the godoc
documentation 🙂
Pingback: Lincoln Georgis
Pingback: Madelyn Monroe Masturbating
Pingback: Lila Lovely
Pingback: MILFCity
Pingback: Cory Chase MILF City
Pingback: premium-domain-broker
Pingback: valentines gift
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: no code robotics
Pingback: robotics case study
Pingback: Click Here
Pingback: Space ROS
Pingback: Click Here
Pingback: Reputation Defenders
Pingback: Reputation Defenders
Pingback: Reputation Defenders
Pingback: Reputation Defenders
Pingback: Click Here
Pingback: Reputation Defenders
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: 온라인바카라사이트
Pingback: Click Here
Pingback: grand rapids dentist
Pingback: grand rapids teeth whitening
Pingback: Click Here
Pingback: grand rapids same day crowns
Pingback: Click Here
Pingback: Click Here
Pingback: https://gquery.org/
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Refer and Earn
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: Click Here
Pingback: When do I need antibiotics buy plaquenil 200mg
Pingback: 온라인 슬롯 머신
Pingback: 온라인 슬롯 머신
Pingback: premium-domains
Pingback: buy-premium-domains
Pingback: Is celery good for your liver
Pingback: Is aspirin an antibiotic
Pingback: How do you tell if it's really asthma
Pingback: What are 5 signs of bipolar
Pingback: What is the most common cause of death in heart failure Lisinopril
Pingback: best book for business startup
Pingback: business blogs
Pingback: Do antibiotics do more harm than good Buy Stromectol 3mg tablets | StromectolMAIL
Pingback: Cialis 5 mg canada pharmacy How long does it take to walk 1 mile - ScwCMD
Pingback: vidalista 20 reddit fildena 100 mg amazon
Pingback: Zithromax 250 mg price - What are the 3 most common parasites
Pingback: Ist Kaffee gut fur die Potenz kamagra erfahrung manner
Pingback: Google reviews
Pingback: buy kamagra oral jelly australia
Pingback: Comment on appelle le Premier-ne de la Famille pharmacie en ligne livraison gratuite
Pingback: Quelle est la structure de la famille pharmacie prix pres de Radom
Pingback: How long should a man take to release sperms?
Pingback: Does a girl like you if she plays hard to get?
Pingback: reputation defenders
Pingback: where can i buy stromectol ivermectin What to avoid while on antibiotics?
Pingback: How do you know if he is the right person to marry?
Pingback: Can a erectile dysfunction be cured?
Pingback: curso formula negócio online funciona?
Pingback: Is Deming still relevant?
Pingback: How can I make my wife happy at night?
Pingback: What is a natural antibiotic for bacterial infection ivermectin injection for cattle
Pingback: Quel vin avant de faire l'amour - viagra naturel homme.
Pingback: What foods should you avoid on antibiotics where can i buy ivermectin
Pingback: What do men need in a relationship cenforce 100mg brand
Pingback: Can I take antibiotics before bed ivermectin horse paste
Pingback: Is Carrot an antibiotic
Pingback: Do antibiotics destroy human cells
Pingback: 2023 Books
Pingback: Is it safe to take antibiotics without doctor
Pingback: Can you drink coffee with antibiotic
Pingback: How do I repair my stomach after antibiotics
Pingback: dying
Pingback: memorial
Pingback: Is amoxicillin a strong antibiotic
Pingback: social security number
Pingback: marriage records
Pingback: Is 5 days of antibiotics enough
Pingback: Is 5 days of antibiotics enough
Pingback: IRA Empire
Pingback: What medications should I avoid with a fatty liver stromectol online pharmacy
Pingback: How many antibiotics can I take in a year
Pingback: levitra professional sale
Pingback: How can I reduce the side effects of antibiotics
Pingback: vardenafil 20 mg tablets