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 🙂

136 thoughts on “go-net-upnp

  1. Pingback: Lincoln Georgis

  2. Pingback: Madelyn Monroe Masturbating

  3. Pingback: Lila Lovely

  4. Pingback: MILFCity

  5. Pingback: Cory Chase MILF City

  6. Pingback: premium-domain-broker

  7. Pingback: valentines gift

  8. Pingback: Click Here

  9. Pingback: Click Here

  10. Pingback: Click Here

  11. Pingback: Click Here

  12. Pingback: Click Here

  13. Pingback: Click Here

  14. Pingback: Click Here

  15. Pingback: Click Here

  16. Pingback: Click Here

  17. Pingback: Click Here

  18. Pingback: Click Here

  19. Pingback: Click Here

  20. Pingback: Click Here

  21. Pingback: Click Here

  22. Pingback: Click Here

  23. Pingback: Click Here

  24. Pingback: Click Here

  25. Pingback: Click Here

  26. Pingback: Click Here

  27. Pingback: Click Here

  28. Pingback: Click Here

  29. Pingback: no code robotics

  30. Pingback: robotics case study

  31. Pingback: Click Here

  32. Pingback: Space ROS

  33. Pingback: Click Here

  34. Pingback: Reputation Defenders

  35. Pingback: Reputation Defenders

  36. Pingback: Reputation Defenders

  37. Pingback: Reputation Defenders

  38. Pingback: Click Here

  39. Pingback: Reputation Defenders

  40. Pingback: Click Here

  41. Pingback: Click Here

  42. Pingback: Click Here

  43. Pingback: Click Here

  44. Pingback: Click Here

  45. Pingback: Click Here

  46. Pingback: Click Here

  47. Pingback: Click Here

  48. Pingback: Click Here

  49. Pingback: Click Here

  50. Pingback: Click Here

  51. Pingback: Click Here

  52. Pingback: 온라인바카라사이트

  53. Pingback: Click Here

  54. Pingback: grand rapids dentist

  55. Pingback: grand rapids teeth whitening

  56. Pingback: Click Here

  57. Pingback: grand rapids same day crowns

  58. Pingback: Click Here

  59. Pingback: Click Here

  60. Pingback: https://gquery.org/

  61. Pingback: Click Here

  62. Pingback: Click Here

  63. Pingback: Click Here

  64. Pingback: Click Here

  65. Pingback: Click Here

  66. Pingback: Click Here

  67. Pingback: Click Here

  68. Pingback: Click Here

  69. Pingback: Click Here

  70. Pingback: Click Here

  71. Pingback: Refer and Earn

  72. Pingback: Click Here

  73. Pingback: Click Here

  74. Pingback: Click Here

  75. Pingback: Click Here

  76. Pingback: Click Here

  77. Pingback: Click Here

  78. Pingback: Click Here

  79. Pingback: Click Here

  80. Pingback: Click Here

  81. Pingback: Click Here

  82. Pingback: Click Here

  83. Pingback: When do I need antibiotics buy plaquenil 200mg

  84. Pingback: 온라인 슬롯 머신

  85. Pingback: 온라인 슬롯 머신

  86. Pingback: premium-domains

  87. Pingback: buy-premium-domains

  88. Pingback: Is celery good for your liver

  89. Pingback: Is aspirin an antibiotic

  90. Pingback: How do you tell if it's really asthma

  91. Pingback: What are 5 signs of bipolar

  92. Pingback: What is the most common cause of death in heart failure Lisinopril

  93. Pingback: best book for business startup

  94. Pingback: business blogs

  95. Pingback: Do antibiotics do more harm than good Buy Stromectol 3mg tablets | StromectolMAIL

  96. Pingback: Cialis 5 mg canada pharmacy How long does it take to walk 1 mile - ScwCMD

  97. Pingback: vidalista 20 reddit fildena 100 mg amazon

  98. Pingback: Zithromax 250 mg price - What are the 3 most common parasites

  99. Pingback: Ist Kaffee gut fur die Potenz kamagra erfahrung manner

  100. Pingback: Google reviews

  101. Pingback: buy kamagra oral jelly australia

  102. Pingback: Comment on appelle le Premier-ne de la Famille pharmacie en ligne livraison gratuite

  103. Pingback: Quelle est la structure de la famille pharmacie prix pres de Radom

  104. Pingback: How long should a man take to release sperms?

  105. Pingback: Does a girl like you if she plays hard to get?

  106. Pingback: reputation defenders

  107. Pingback: where can i buy stromectol ivermectin What to avoid while on antibiotics?

  108. Pingback: How do you know if he is the right person to marry?

  109. Pingback: Can a erectile dysfunction be cured?

  110. Pingback: curso formula negócio online funciona?

  111. Pingback: Is Deming still relevant?

  112. Pingback: How can I make my wife happy at night?

  113. Pingback: What is a natural antibiotic for bacterial infection ivermectin injection for cattle

  114. Pingback: Quel vin avant de faire l'amour - viagra naturel homme.

  115. Pingback: What foods should you avoid on antibiotics where can i buy ivermectin

  116. Pingback: What do men need in a relationship cenforce 100mg brand

  117. Pingback: Can I take antibiotics before bed ivermectin horse paste

  118. Pingback: Is Carrot an antibiotic

  119. Pingback: Do antibiotics destroy human cells

  120. Pingback: 2023 Books

  121. Pingback: Is it safe to take antibiotics without doctor

  122. Pingback: Can you drink coffee with antibiotic

  123. Pingback: How do I repair my stomach after antibiotics

  124. Pingback: dying

  125. Pingback: memorial

  126. Pingback: Is amoxicillin a strong antibiotic

  127. Pingback: social security number

  128. Pingback: marriage records

  129. Pingback: Is 5 days of antibiotics enough

  130. Pingback: Is 5 days of antibiotics enough

  131. Pingback: IRA Empire

  132. Pingback: What medications should I avoid with a fatty liver stromectol online pharmacy

  133. Pingback: How many antibiotics can I take in a year

  134. Pingback: levitra professional sale

  135. Pingback: How can I reduce the side effects of antibiotics

  136. Pingback: vardenafil 20 mg tablets