MCPcopy
hub / github.com/bettercap/bettercap / showBLE

Method showBLE

modules/api_rest/api_rest_controller.go:136–147  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

134}
135
136func (mod *RestAPI) showBLE(w http.ResponseWriter, r *http.Request) {
137 params := mux.Vars(r)
138 mac := strings.ToLower(params["mac"])
139
140 if mac == "" {
141 mod.toJSON(w, mod.Session.BLE)
142 } else if dev, found := mod.Session.BLE.Get(mac); found {
143 mod.toJSON(w, dev)
144 } else {
145 http.Error(w, "Not Found", 404)
146 }
147}
148
149func (mod *RestAPI) showHID(w http.ResponseWriter, r *http.Request) {
150 params := mux.Vars(r)

Callers 1

sessionRouteMethod · 0.95

Calls 3

toJSONMethod · 0.95
GetMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected